Ivica Crnkovic Mälardalen University Department of Computer Science and Engineering ivica.crnkovic@mdh.se http://www.idt.mdh.se/~icc Software engineering and Scientific Methods Page 1, 10/21/2008 Contents What Wh t is i Software S ft Engineering? E i i ? Software Engineering and Science Methods M th d off Software S ft Engineering E i i Software Engineering Research Example E l – Software S ft architecture hit t Software engineering and Scientific Methods Page 2, 10/21/2008 What is Software Engineering? Software engineering is an engineering discipline which is concerned with all aspects of software production from the early stages of system specification through to maintaining the system after gone into use. Ian Sommerville, Software Engineering We need further explanation of: z Engineering discipline z All aspects of software production Software engineering and Scientific Methods Page 3, 10/21/2008 Engineering Engineers make the things work Solving g problems p understand the problem analyze y the p problem Find solutions Constructing g the solution from p parts that address the p problem's various aspects - do a synthesis To achieve the goal engineers apply theories, methods and tools from different disciplines Search for solutions even when there is not theory or methods Software engineering and Scientific Methods Page 4, 10/21/2008 Analysis of a problem PROBLEM Identify different aspects of the problem Arrange the problems in clearly defined and understandable sub-problems Subproblem 1 Subproblem 2 Subproblem 3 Software engineering and Scientific Methods Page 5, 10/21/2008 The synthesis Find solutions for subproblems Sol tion 1 Solution Sol tion 2 Solution Solution 3 S l i 4 Solution Put together solutions to a consistent view Provide (make) a solution SOLUTION Software engineering and Scientific Methods Page 6, 10/21/2008 Engineering Example – the Vasa Ship A master piece of work! 1625 King Gustav II Adolf decided to start build Wasa 1628 - maiden voyage voyage. Length- 69 metres LengthMaximum width - 11.7 metres From keel to the top of the main mast - 52.5 metres Height of the stern - 19.3 metres Crew: 445 men men, Seamen – 145 145,, Soldiers - 300 Armament 64 guns Thousands of people involved in the project Selecting wood, building different parts g food,, other services Providing Software engineering and Scientific Methods Page 7, 10/21/2008 WHat happen with the Vasa ship? Software engineering and Scientific Methods Page 8, 10/21/2008 Vasa – Example of Bad Engineering the ship capsized on her maiden voyage in the harbor of Stockholm. Why did the Vasa capsize? Software engineering and Scientific Methods Page 9, 10/21/2008 Why y did the Vasa capsize? p The Th V Vasa capsized i d because b it was nott stable; t bl The Vasa capsized because z th methods the th d ffor calculating l l ti stability t bilit were now kknown )or z the building process (or in terms of software engineering engineering, the development project) was inadequate. Software engineering and Scientific Methods Page 10, 10/21/2008 How to calculate stability? Gravity y force Ship weight Buoyancy (bärkraft) Ship’s center of gravity Center of buoyancy (water) displacement The forces are of equal size and in the opposite directions Software engineering and Scientific Methods Page 11, 10/21/2008 The ship heels at an angle h Ship’s center of gravity Software engineering and Scientific Methods h – leverage effect ( åt k i ) (påtryckning) Center of buoyancy (water displacement) Has moved right Page 12, 10/21/2008 Leverage effect (Moment) Torque is defined as the product of radius, force, and the sine of the angle between force and radius: t = r F (sin(X)) X http://members.aol.com/PhysicsDad/calcphys/lecture.html Software engineering and Scientific Methods Page 13, 10/21/2008 The ship heels at an angle h – leverage effect ( åt k i ) (påtryckning) This s Torque o que (Moment) ( o e t) will force the Ship to return back h Software engineering and Scientific Methods Page 14, 10/21/2008 The ship is unstable h – leverage effect (påtryckning) Torque has change the direction The ship will capsized h h Software engineering and Scientific Methods Page 15, 10/21/2008 The ship is stable If the center of gravity is very low – the ship will be stable h Software engineering and Scientific Methods Page 16, 10/21/2008 h Why the ships heel? Because of wind! Or waves… h Software engineering and Scientific Methods Page 17, 10/21/2008 Stability y Curve Torque Result = S - W Wind (opposite direction) A S2 B S1 αΑ α1 αΒ α2 Software engineering and Scientific Methods α Page 18, 10/21/2008 Why did Vasa capsize? It was nott stable t bl z At that time there was no formal modeling for calculating stability But at that time there were many ships which did not capsized! Software engineering and Scientific Methods Page 19, 10/21/2008 Why did Vasa capsize? Engineering E i i – z Solve problems even when there is no formal theory z Experience – best practices z Ob Observations ti z Rules of thumb z P Processes to t ensure the th ffeasibility ibilit off problem bl solving l i z COULD VASA BE SUCSSESFULLY BUILT IN SPITE OF LACK OF THEORY? z WHAT DID PROJECT FAILED TO DO? Software engineering and Scientific Methods Page 20, 10/21/2008 Other reasons why Vasa capsized? Resource & budget plan. The project was delayed and in its later phases, there was enormous pressure to finish work on time. ti Project management. management The main builder (or in modern terms, terms the project manager) unfortunately sickened and died during the building of the ship, and the consequence was weak managementt and d very poor coordination di ti off the th groups building different parts. Changes in requirements. The original requirement for one gun deck was changed to two gun decks when the building of the ship had already begun. Because the king was behind the decision, its possible consequences were not analyzed. Software engineering and Scientific Methods Page 21, 10/21/2008 Other reasons why Vasa capsized? Conflicting requirements and trade-off analysis. The Vasa was intended to be a new type of ship combining superior sailing ili characteristics h t i ti and d maneuverability bilit with ith overwhelming striking force. Design changes during the construction. The dimensions of the ship were changed several times during its construction with ith no proper analysis l i off the th consequences. S Scalability. l bilit Vasa V was designed d i d as a smaller ll ship, hi and d its it dimensions were merely proportionally increased. Validation. The stability and other tests were primitive and not well performed. (Test: running across the deck) Software engineering and Scientific Methods Page 22, 10/21/2008 Vasa Disaster – Similar do Software Projects Si il situation Similar i i in i software f development d l project j No formal/theoretical background for requirements and solution Feasibility of the requirements not analyzed Changes in requirements during the project work Time and Budget not properly planned No proper verification/validation Bad quality assurance Shortage in knowledge in new disciplines .... Software engineering and Scientific Methods Page 23, 10/21/2008 Engineering vs. Software Engineering Many similarities Methods and procedures Similar objectives and goals Many differences Difference between software and hardware/the real world Software – no physical limits Not visible Modifiable More complex Different theories and methods used Different experiences experiences, traditions Different maturity level Software engineering and Scientific Methods Page 24, 10/21/2008 All aspects of Software Development Aspects A t z Technical (how technically solve the problem) z O Organizational i ti l (h (how tto organize i people) l ) z Financial z M k ti Marketing z Professional and ethical responsibility z R Research h and dS Science i Software engineering and Scientific Methods Page 25, 10/21/2008 Example – distributed software development Developing D l i software ft on different diff t locations l ti z Advantages: …. z Di d Disadvantages…. t z Diff Different t ttechniques, h i diff differentt processes, different diff t people l Software engineering and Scientific Methods Page 26, 10/21/2008 How to break the barriers? Teachers teachers Common Course Common projects Students Students Video Conference Web Cameras Chat - Messengers Mail Web Database Software engineering and Scientific Methods Page 27, 10/21/2008 Computer Science Vs. Software Engineering COMPUTER SCIENCE Computer Functions OTHER SCIENCES Theories CUSTOMER Problem SOFTWARE ENGINEERING Software Engineering Research & Science Principles, Methods and Tools to Solve Problem and Construct sSolutions Software engineering and Scientific Methods Solution Page 28, 10/21/2008 Computer Science Vs. Software Engineering COMPUTER SCIENCE Algorithms and data structures Programming languages Architecture Numerical and symbolic computation Operating systems SOFTWARE ENGINEERING Software methodology and engineering Databases and information retrieval Artificial intelligence and robotics Human computer communication Human-computer In many cases a defuse Social, ethical, and professional issues boundaries between SE and CS Software engineering and Scientific Methods Page 29, 10/21/2008 Methods and Technologies Solution Phases Requirements Analysis Design Implementation Test Delivery Maintenance Service Software/Systems Engineering Methods Different e e t Technologies ec o og es Software engineering and Scientific Methods Page 30, 10/21/2008 SE disciplines and areas From European Software Engineering Conference and Symposium on the Foundations of Software Engineering Req Requirements irements Engineering Specification and Verification Software Architecture and Design Analysis and Testing Development Paradigms and Software Processes Evolution and Refactoring Tools and Environments Empirical Software Engineering Software Metrics Software Quality and Performance Component Component-based based Software Soft are Engineering Model Driven Engineering Web Applications Distributed Systems and Middleware Service Oriented Applications Mobile and Embedded System Open O Standards S and Certification Software Economics and H Human R Resources Dependability (safety, security, reliability) Case Studies and Experience Software engineering and Scientific Methods Reports Page 31, 10/21/2008 SE disciplines - more examples Project management Real-time Development processes Tools and environments Reverse engineering Software Configuration Management Software Maintenance Object-oriented Object oriented modelling Formal specification Software dependability (reliability, safety,…) So t a e e engineering g ee g a and d tthe e Software Internet Education Software Economics ...... Software engineering and Scientific Methods Page 32, 10/21/2008 Software Engineering Methods - Examples Requirements Analysis Design Implementation Test Delivery Maintenance Service Project Management Software Development Models and Processes support Component based Software Engineering (CBSE) Component-based Requirements Engineering Analyse/design y g methods (UML, ( OOP, Formal methods, ...)) Architectural analysis (tradeoff analysis, quality, attributes…) Programming Methods /Languages Configuration Management Test and Verification Customer support, Maintenance Software engineering and Scientific Methods Page 33, 10/21/2008 What is then Software Engineering Research? Analyzing natures of problems and their solutions Finding more general principles that SE can use Developing methods and tools Implementing principles on new problem domains …… Software engineering and Scientific Methods Page 34, 10/21/2008 Software Engineering Research Different methods used SE Exemplified by Software Architecture z Presentation extracted from Mary Shaw Shaw’s s presentation on ICSE 2001 in Toronto http://www-2 http://www 2.cs.cmu.edu/ cs cmu edu/~Compose/paper Compose/paper_abstracts/etaps abstracts/etaps-2002 2002.html html Software engineering and Scientific Methods Page 35, 10/21/2008 The basic characteristic of SE REAL WORLD Practical problem ? REAL WORLD Practical Solution Software engineering and Scientific Methods Page 36, 10/21/2008 Software engineering and Scientific Methods Page 37, 10/21/2008 Research Strategy gy Software engineering and Scientific Methods Page 38, 10/21/2008 Validation of the Result Software engineering and Scientific Methods Page 39, 10/21/2008 Nasreddin story and Software Engineering Story about a lost ring N Nasreddin ddi Hodja H dj Software engineering and Scientific Methods Page 40, 10/21/2008 Software engineering and Scientific Methods Page 41, 10/21/2008 SE Research process Research R hQ Questions ti Research Results Result Validation Software engineering and Scientific Methods Page 42, 10/21/2008 Software engineering and Scientific Methods Page 43, 10/21/2008 Software engineering and Scientific Methods Page 44, 10/21/2008 Example: Software Architecture The software architecture of a program or computing system is the structure or structures of the system, y , which comprise p software components, the externally visible properties of those components and the relationships among them L. Bass, L B P. P Cl Clements, R R. K Kazman, Software S ft Architecture A hit t In I Practise, P ti Addi Addison Wesley, 1998 System S Subsystem subsystem component component Software engineering and Scientific Methods component Page 45, 10/21/2008 Software engineering and Scientific Methods Page 46, 10/21/2008 Software engineering and Scientific Methods Page 47, 10/21/2008 Software engineering and Scientific Methods Page 48, 10/21/2008 Software engineering and Scientific Methods Page 49, 10/21/2008 Software engineering and Scientific Methods Page 50, 10/21/2008 Software engineering and Scientific Methods Page 51, 10/21/2008 Software engineering and Scientific Methods Page 52, 10/21/2008 Software engineering and Scientific Methods Page 53, 10/21/2008 Software engineering and Scientific Methods Page 54, 10/21/2008 Software engineering and Scientific Methods Page 55, 10/21/2008 Software engineering and Scientific Methods Page 56, 10/21/2008 Software engineering and Scientific Methods Page 57, 10/21/2008 Software engineering and Scientific Methods Page 58, 10/21/2008 Software engineering and Scientific Methods Page 59, 10/21/2008 Software engineering and Scientific Methods Page 60, 10/21/2008 Software engineering and Scientific Methods Page 61, 10/21/2008 Research Model – different phases in research life cycle Software engineering and Scientific Methods Page 62, 10/21/2008 Example:Software architecture New concept: p system y decomposition p System subsystem component S b Subsystem t component Software engineering and Scientific Methods component Page 63, 10/21/2008 Next step – Characterisation - Architectural Style Recurring structures that occur in software systems AS = {Component types,Connector types,Constraints} Component and Connector Types Pipe and Filter Shared Repository Layered Abstract Machines Buss Software engineering and Scientific Methods Page 64, 10/21/2008 Next step: Aspects of Software Architecture Further characterisation Elements and Form Attachment Connector Arch Component Port Representation Role (sub)System Rationale ¾ Describes how the architecture satisfies system requirements for both functional and extra-functional properties. Software engineering and Scientific Methods Page 65, 10/21/2008 Next step: Formalization Example p - UML IComA <<subsystem>> ComA IComB <<subsystem>> ComB Conceptual Architecture IComA <<subsystem>> ComC Software engineering and Scientific Methods Page 66, 10/21/2008 Software engineering and Scientific Methods Page 67, 10/21/2008 Software engineering and Scientific Methods Page 68, 10/21/2008 Software engineering and Scientific Methods Page 69, 10/21/2008 Summary Software S f E Engineering i i is i oriented i d on practical i l things hi from the real word z Understanding problems, providing software f solutions SE uses methods and tools for solving the problems from different disciplines SE research z Understanding principles z Defining principle for solving the problems z Developing methods and tools Software engineering and Scientific Methods Page 70, 10/21/2008