Microsoft Software Project Development Method - How to write excellent procedures (main lecture: Lin Bin) video notes

zhaozj2021-02-16  92

Microsoft Software Project Development Method - How to write excellent procedures: Lin Bin organizes: Microsoft China Institute December 03, 2001

Two major elements of writing procedures: 1. Design system structure design (design Architec by experienced engineers) - large projects with high complexity Windows 2000 Exchange 2000 detailed development and design (design) 2, programming first class Source code --------- Design characteristics:

1/3 - 1 / 4no Major Production Code Wirtten, Just - Prototype - Tools - General ALGORITHMS, has no detailed design code, which is likely to be overridden

Data structure, cache, linked list, and other data structures. -------- (The most important thing in the design is the design document)

Design documentation

Spec sampled template - Summary Overview- Design Goals (It's very important) - Scenarios (users with the story of this software, the user promotional sales department) - Dependecncy - Design Requirements Perfermance Setup and Configuration Re-use Robustness Security- Test Requirments (test personnel is 1.5 -2 times the developer) list of difficult scenarios Simulating Fail Verify correctness- Detailed Design Design Pattern Classes and header files (arguments each function, a very specific write) Algorithem Implementation- Schedule- Open issues- Change history -------------- Design. A Case Study

Design A Scalable SMTP Server - Goal: Scalable - 2-CPU, 4-CPU, 8-CPU Machines - Handle As Many Request As Possible, with relative fast response time.

A Simple SMTP Server // Read SMTP Commandds / Date from Socketsif (ReadFile (...) {// Various Housekeeping Removed ...}

// PARSE SMTP Recipicants and Other Headersif (! Parsesmtpheaders (.)) {// Handle Errors}

// Parse Bodiesif (! ParsesmtpBodies (.)) {// handle errors}

// Local Delivery or routingif (localdelivery (.)) {DELIVER (.);} Else {route (..);

// send SMTP RESPONSE THROUGH Socketif (Writefile (.)) {//Various housekeeping skips ..} ---------------- TRADITONAL THREAD ARCHITECTURE

1 Thread to Receive and Dispatch SMTP Request64 Worker Threads Database - Parse SMTP Headers - Parse SMTP Bodies - Local Delivery - Routing- All in The Same the Conses ------------------------------------------------------------------------------ -The Fact: Evolution of Hardware

The CPU has the fastest growth rate, and the growth rate of RAM is half of the CPU, and the speed of the hard disk has little increase. ----------------- The Fact: Bridge the Gap - Caches

CPU L1 Cache - 8K Instruction Cache, Plus - 8k Data Cache - Closely Coupled - 3 Clock / Instruction

CPU L2 Cache - 512k Static Ram - Coupled with Full Clock-Speed, 64-Bit, Cache Bus - Latency: 4-1-1-1, -7 Clocks / Instruction - I / O Caches (Ram Baysed File Caches)

------------------------------ The Fact: The Price of Failure

Let's look at the cost:

- Assume 1 Second to Zero a Register- L1 Cache Hit - 1 Second (1x) - L2 Cache Hit - 4 Seconds (Plus 3 Seconds Extra Work - 7X) - RAM HIT - 25 - 150 Seconds (24x - 150x) - Disk OR Net Hit - 3 Weeks (2,000,000X)

------------------------ SMTP Server Architecture

1 thread to receive and dispatch smtp Request2 WORKER Threads Per cpuevent loops - Parse SMTP Headers / Bodies - Local Delivery- Routing- Socket Send and File I / O

One Queue for EACH EVENT LOOPS --------------------

Recommended book:

1, DESING PATTEN, Erich, Gaxma. Richard Helon, ISBN 0-201-63361-2

------------------------ One-phase source code

Solid and Robust CodeMall CodeRe-usable Codetestable CodePortable Code (difficulties how to balance in these properties) -------------------- 1, McDonald's Operating - Follow Basic Coding Standard

! Your code may outlive you or your memory Think about the maintainerComment your code File Header Function Header Inline CommentingPick a good name for your functions and varibales naming convetions - HungananAlign your codeLess argumentsUse all uppercase with underscores for macroDeclare all your variables at the start of function .Avoid hard coding constant, Use enum or macrouser braces for one line code the length of a single function -------------------- What is the maximum length of a Function

Watch out for functions> 200 lines! Study in 1986 on IBM's OS / 360: The Most Error-Prone Routines => LONGER THAN 500 LINES.STUDY IN 1991 on 148,000-line of code: functions <143 lines => 2.4 Times Less Exencyive To FIX THEN LONGER FUNCTIONS

Function's Longth Is Less Than 143 Lines.

-----------------------

Naming Conventions Hungarian nomenclature

-----------------------

Don't lazy, practice defensive coding

Initialize Variablescheck Return Valueskeeskeep It Simples Usually, Simplicity = Performancekeep It Clean Multi-Thread Clean Minimize Castsavoid Miscalculatons Divide by ZERO Positive Negative

----------------------------- Put down the "cattle" shelf Test But don't stop there

Walking over the debugger, twice, three times especially the error code paths a few times Test As Much of Your Code As you can never gone sure not Workcode Review Have Somebody else read IT and read Somebody else's Code

-------------------------

Dounger rewrite code Avoid Assumptions

Don't trust anyone there. An Interface May Have Live Section - ISER BUT DON't Abuse ASSERT

--------------- The highest realm, no stroning, STOP WRITTING SO MUCH CODE.

More code is not betterthink twice before you cut-and-paster

------------------------ Rigorous academic attitude It's all about attitude

Take Pride in your code, get your ego wrappe, it. ------------------------ Research page: http://www.microsoft .com / chinaasearch Lin Bin e-mail: binlin@microsoft.com -------------------- Microsoft's requirements for engineers

Data structure, basic algorithm, patience, confidence, -----------

Priority of software development: Work -> Robust -> Performance ->..

System software development focuses on efficiency, performance, development with C language.

Application software is developed to focus on UI Attractive, starting speed (should be considered by the user's machine configuration)

-----------

The work of Program Manager is to work with internal external coordination. He is not only familiar with yourself, but also must work for other Teams.

Familiar with a language, then make full use of it, it is enough.

Microsoft wants to announce the source code of WinCe, first change it to run on the desktop.

Announce some of the features of Win Kernel to implement some features of Windows.

转载请注明原文地址:https://www.9cbs.com/read-14371.html

New Post(0)