290 likes | 320 Views
Explore the fundamentals of software engineering complexity with Ivan Marsic at Rutgers University. Learn about the role of software engineers, development methods, and the importance of understanding problem domains. Discover how ATM machines work through a customer-centric approach.
E N D
LECTURE 1: Introduction Lecture time: 1 hr. 20 min. Ivan Marsic Rutgers University
Introduction: Software is Complex • Complex complicated • Complex = composed of many simple parts related to one another • Complicated = not well understood, or explained
Complexity Example: Scheduling Fence Construction Tasks Nailing Painting Setting posts [ 3 time units ] Cutting wood [ 2 time units ] [ 2 time units for unpainted; 3 time units otherwise ] [ 5 time units for uncut wood; 4 time units otherwise ] Setting posts Nailing, Painting Cutting Nailing …shortest possible completion time = ? 8 [ “simple” problem, but hard to solve without a pen and paper ]
The Role of Software Engr. (1) A bridge from customer needs to programming implementation Customer Programmer First law of software engineering Software engineer is willing to learn the problem domain (problem cannot be solved without understanding it first) 10
The Role of Software Engr. (2) Customer: Requires a computer system to achieve some business goals by user interaction or interaction with the environment in a specified manner System-to-be System-to-be Environment Software-to-be Software-to-be User Software Engineer’s task: To understand how the system-to-be needs to interact with the user or the environment so that customer’s requirement is met and design the software-to-be Programmer’s task: To implement the software-to-be designed by the software engineer May be the same person 11
Example: ATM Machine Understanding the money-machine problem: Communication link 1 2 3 8 9 0 0 0 1 2 3 8 9 1 2 3 4 5 6 8 9 4 5 6 4 5 6 7 7 7 Bank’s remote datacenter ATM machine Bank customer 12
How ATM Machine Might Work Domain Model Domain model created with help of domain expert Transaction record How may I help you? Cash Bookkeeper Speakerphone Safe Safe keeper Phone Window clerk Datacenter liaison Dispenser Bank’s remote datacenter 13 Customer
Cartoon Strip: How ATM Machine Works C C A A D D B B Verify account XYZ XYZ Verify account Enter your PIN your PIN Enter Verify this account account Verify this Account valid. Balance: $100 $100 Account valid. Balance: Typing in PIN number Typing in PIN number … … XYZ valid. Balance: XYZ valid. Balance: $100 $100 G G F F E E Record $60 less $60 less Record How may I help you? you? How may I help Release $60 $60 Release Dispensing! Dispensing! H H Dispense $60 $60 Dispense Withdraw Withdraw $60 $60 Please take your cash your cash Please take 14
Second Law of Software Engineering • Software should be written for people first – ( Computers run software, but hardware quickly becomes outdated ) – Useful + good software lives long – To nurture software, people must be able to understand it 16
Software Development Methods ØMethod = work strategy § The Feynman Problem-Solving Algorithm: (i) Write down the problem (ii) think very hard, and (iii) write down the answer. ØWaterfall § Unidirectional, finish this step before moving to the next ØIterative + Incremental § Develop increment of functionality, repeat in a feedback loop ØAgile § User feedback essential; feedback loops on several levels of granularity 17
Waterfall Method Requirements Design Implementation Testing Waterfall method Deployment & Maintenance Unidirectional, no way back finish this step before moving to the next 18
UML – Language of Symbols UML = Unified Modeling Language «interface» BaseInterface Stereotype « » provides additional info/ annotation/ explanation ClassName + operation() # attribute_1 : int # attribute_2 : boolean # attribute_3 : String Three common compartments: 1. Inheritance relationship: BaseInterface is implemented by two classes Classifier name + operation_1() : void + operation_2() : String + operation_3(arg1 : int) Class1Implement Class2Implement 2. Attributes + operation() + operation() 3. Operations Software Class Actor Comment Software Interface Implementation instance1 : Class1 instance5 : Class2 instance8 : Class3 doSomething() doSomethingElse() Interaction Diagram Online information: http://www.uml.org doSomethingYetElse() 19
Understanding the Problem Domain • System to be developed • Actors – Agents external to the system • Concepts/ Objects – Agents working inside the system • Use Cases – Scenarios for using the system 20
ATM: Gallery of Players 1 1 2 2 4 4 3 3 5 5 7 7 6 9 9 6 8 8 0 0 System System Bank’s remote Bank’s remote datacenter datacenter Bank customer Bank customer (ATM machine) (ATM machine) Actors (Easy to identify because they are visible!) 21
Gallery of Workers + Things Datacenter liaison Window clerk Bookkeeper Safe keeper Dispenser Transaction record Speakerphone Telephone Safe Cash Concepts(Hard to identify because they are invisible/imaginary!) 22
Use Case: Withdraw Cash B B Verify account XYZ XYZ Verify account A A C C How may I help How may I help you? you? Enter your PIN your PIN Enter 1 2 3 7 8 9 1 2 3 7 8 9 0 0 0 0 1 2 3 7 8 9 1 2 3 7 8 9 4 5 6 4 5 6 4 5 6 4 5 6 1 2 3 7 8 9 0 0 0 0 1 2 3 7 8 9 1 2 3 7 8 9 1 2 3 7 8 9 4 5 6 4 5 6 4 5 6 4 5 6 XYZ valid. Balance: $100 $100 XYZ valid. Balance: Typing in PIN number … … Typing in PIN number Withdraw Withdraw $60 $60 D D E E XYZ withdrew XYZ withdrew $60 $60 Please take Please take your cash your cash 1 2 3 7 8 9 0 0 0 0 1 2 3 7 8 9 1 2 3 7 8 9 1 2 3 7 8 9 4 5 6 4 5 6 4 5 6 4 5 6 Collecting Collecting cash … cash … Acknowledged Acknowledged 23
Software Measurement • What to measure? – Project (developer’s work), for budgeting and scheduling – Product, for quality assessment 28
Sizing the Problem (1) Step 1: Divide the problem into small & similar parts Step 2: Estimate relative sizes of all parts Size( ) = 4 Size( ) = 7 Size( ) = 10 Size( ) = 3 Size( ) = 4 Size( ) = 2 Size( ) = 4 Size( ) = 7
Sizing the Problem (2) • Step 3: Estimate the size of the total work points-for-section i Total size = (i = 1..N) • Step 4: Estimate speed of work (velocity) • Step 5: Estimate the work duration Path size Travel duration = Travel velocity
Sizing the Problem (3) • Advantages: – Velocity estimate may need to be adjusted (based on observed progress) – However, the total duration can be computed quickly (provided that the relative size estimates of parts are accurate – easier to achieve if the parts are small and similar-size)
Exponential Cost of Estimation 100% Estimation accuracy Estimation cost q Improving accuracy of estimation beyond a certain point requires huge cost and effort (known as the law of diminishing returns) q In the beginning of the curve, a modest effort investment yields huge gains in accuracy 33
Estimation Error Over Time Estimation error Requirements Design Implementation Start Completion Time The cone of uncertainty starts high and narrows down to zero as the project approaches completion.
Measuring Quality of Work Good Shape (Low branches get sun) Poor Shape (Low branches shaded from sun) Heading back not recommended as it alters the natural shape of the shrub Remove dead wood Remove water spouts and suckers Rounded forms, which follow nature’s tendency, require less trimming Snow accumulates on broad flat tops Straight lines require more frequent trimming Peaked and rounded tops hinder snow accumulation 36
Concept Maps Useful tool for problem domain description SENTENCE: “ “My friend is coding a new program” ” translated into propositions I Proposition Concept Relation Concept have 1. I have friend friend 2. friend engages in coding engages in 3. coding constructs a program 4. program is new coding constructs a program is Search the Web for Concept Maps new 37
Case Study: Home Access Control • Objective: Design an electronic system for: – Home access control • Locks and lighting operation – Intrusion detection and warning Alarm bell System Light bulb 1 2 3 4 5 X Y Y 1 2 3 4 5 X Lock Photosensor Switch 38
Case Study – More Details Alarm bell System 1 2 3 4 5 X Y Y 1 2 3 4 5 X Light bulb Lock Photosensor Switch 39
Concept Map for Home Access Control tenant enters wishes key can be upper bound on failed attempts valid key invalid key causes lock opened can be prevented by enforcing may signal burglar launches dictionary attack 41