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, 3/12/2016 Contents What is Software Engineering? Software Engineering and Science Methods of Software Engineering Software Engineering Research Example – Software architecture Software engineering and Scientific Methods Page 2, 3/12/2016 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: Engineering discipline All aspects of software production Software engineering and Scientific Methods Page 3, 3/12/2016 Engineering Engineers make the things work Solving problems understand the problem analyze the problem Find solutions Constructing the solution from parts that address the 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, 3/12/2016 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, 3/12/2016 The synthesis Find solutions for subproblems Solution 1 Solution 2 Solution 3 Solution 4 Put together solutions to a consistent view Provide (make) a solution SOLUTION Software engineering and Scientific Methods Page 6, 3/12/2016 Engineering Example – the Vasa Ship A master piece of work! 1625 King Gustav II Adolf decided to start build Wasa 1628 - maiden voyage. Length- 69 metres Maximum 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, Seamen – 145, Soldiers - 300 Armament 64 guns Thousands of people involved in the project Selecting wood, building different parts Providing food, other services Software engineering and Scientific Methods Page 7, 3/12/2016 WHat happen with the Vasa ship? Software engineering and Scientific Methods Page 8, 3/12/2016 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, 3/12/2016 Why did the Vasa capsize? The Vasa capsized because it was not stable; The Vasa capsized because the methods for calculating stability were now known or the building process (or in terms of software engineering, the development project) was inadequate. Software engineering and Scientific Methods Page 10, 3/12/2016 How to calculate stability? Gravity 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, 3/12/2016 The ship heels at an angle h Ship’s center of gravity Software engineering and Scientific Methods h – leverage effect (påtryckning) Center of buoyancy (water displacement) Has moved right Page 12, 3/12/2016 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, 3/12/2016 The ship heels at an angle h – leverage effect (påtryckning) This Torque (Moment) will force the Ship to return back h Software engineering and Scientific Methods Page 14, 3/12/2016 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, 3/12/2016 Why the ships heel? Because of wind! Or waves… h Software engineering and Scientific Methods Page 17, 3/12/2016 Stability Curve Torque Result = S - W Wind (opposite direction) A S2 B S1 aA a1 aB a2 Software engineering and Scientific Methods a Page 18, 3/12/2016 Why did Vasa capsize? It was not stable 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, 3/12/2016 Why did Vasa capsize? Engineering – Solve problems even when there is no formal theory Experience – best practices Observations Rules of thumb Processes to ensure the feasibility of problem solving COULD VASA BE SUCSSESFULLY BUILT IN SPITE OF LACK OF THEORY? WHAT DID PROJECT FAILED TO DO? Software engineering and Scientific Methods Page 20, 3/12/2016 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. Project management. The main builder (or in modern terms, the project manager) unfortunately sickened and died during the building of the ship, and the consequence was weak management and very poor coordination of the 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, 3/12/2016 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 characteristics and maneuverability with overwhelming striking force. Design changes during the construction. The dimensions of the ship were changed several times during its construction with no proper analysis of the consequences. Scalability. Vasa was designed as a smaller ship, and its 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, 3/12/2016 Vasa Disaster – Similar do Software Projects Similar situation in software development project 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, 3/12/2016 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, traditions Different maturity level Software engineering and Scientific Methods Page 24, 3/12/2016 All aspects of Software Development Aspects Technical (how technically solve the problem) Organizational (how to organize people) Financial Marketing Professional and ethical responsibility Research and Science Software engineering and Scientific Methods Page 25, 3/12/2016 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, 3/12/2016 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 In many cases a defuse Social, ethical, and professional issues boundaries between SE and CS Software engineering and Scientific Methods Page 29, 3/12/2016 Methods and Technologies Solution Phases Requirements Analysis Design Implementation Test Delivery Maintenance Service Software/Systems Engineering Methods Different Technologies Software engineering and Scientific Methods Page 30, 3/12/2016 SE disciplines and areas From European Software Engineering Conference and Symposium on the Foundations of Software Engineering Requirements 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-based Software Engineering Model Driven Engineering Web Applications Distributed Systems and Middleware Service Oriented Applications Mobile and Embedded System Open Standards and Certification Software Economics and Human Resources Dependability (safety, security, reliability) Case Studies and Experience Software engineering and Scientific Methods Reports Page 31, 3/12/2016 SE disciplines - more examples Project management Real-time Development processes Tools and environments Reverse engineering Software Configuration Management Software Maintenance Object-oriented modelling Formal specification Software dependability (reliability, safety,…) Software engineering and the Internet Education Software Economics ...... Software engineering and Scientific Methods Page 32, 3/12/2016 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, 3/12/2016 Software Engineering Research Different methods used SE Exemplified by Software Architecture Presentation extracted from Mary Shaw’s presentation on ICSE 2001 in Toronto http://www-2.cs.cmu.edu/~Compose/paper_abstracts/etaps-2002.html Software engineering and Scientific Methods Page 35, 3/12/2016 The basic characteristic of SE REAL WORLD Practical problem ? REAL WORLD Practical Solution Software engineering and Scientific Methods Page 36, 3/12/2016 Software engineering and Scientific Methods Page 37, 3/12/2016 Research Strategy Software engineering and Scientific Methods Page 38, 3/12/2016 Validation of the Result Software engineering and Scientific Methods Page 39, 3/12/2016 Nasreddin story and Software Engineering Story about a lost ring Nasreddin Hodja Software engineering and Scientific Methods Page 40, 3/12/2016 Software engineering and Scientific Methods Page 41, 3/12/2016 SE Research process Research Questions Research Results Result Validation Software engineering and Scientific Methods Page 42, 3/12/2016 Software engineering and Scientific Methods Page 43, 3/12/2016 Example: Software Architecture The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components and the relationships among them L. Bass, P. Clements, R. Kazman, Software Architecture In Practise, Addison Wesley, 1998 System Subsystem subsystem component component Software engineering and Scientific Methods component Page 45, 3/12/2016 Software engineering and Scientific Methods Page 46, 3/12/2016 Software engineering and Scientific Methods Page 47, 3/12/2016 Software engineering and Scientific Methods Page 48, 3/12/2016 Software engineering and Scientific Methods Page 49, 3/12/2016 Software engineering and Scientific Methods Page 50, 3/12/2016 Software engineering and Scientific Methods Page 51, 3/12/2016 Software engineering and Scientific Methods Page 52, 3/12/2016 Software engineering and Scientific Methods Page 55, 3/12/2016 Software engineering and Scientific Methods Page 56, 3/12/2016 Software engineering and Scientific Methods Page 57, 3/12/2016 Software engineering and Scientific Methods Page 58, 3/12/2016 Software engineering and Scientific Methods Page 59, 3/12/2016 Software engineering and Scientific Methods Page 60, 3/12/2016 Research Model – different phases in research life cycle Software engineering and Scientific Methods Page 62, 3/12/2016 Example:Software architecture New concept: system decomposition System subsystem component Subsystem component Software engineering and Scientific Methods component Page 63, 3/12/2016 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, 3/12/2016 Next step: Aspects of Software Architecture Further characterisation Elements and Form Attachment Connector Arch Component Port Role Representation (sub)System Rationale Describes how the architecture satisfies system requirements for both functional and extra-functional properties. Software engineering and Scientific Methods Page 65, 3/12/2016 Next step: Formalization Example - UML IComA <<subsystem>> ComA IComB <<subsystem>> ComB Conceptual Architecture IComA <<subsystem>> ComC Software engineering and Scientific Methods Page 66, 3/12/2016 Software engineering and Scientific Methods Page 68, 3/12/2016 Software engineering and Scientific Methods Page 69, 3/12/2016 Summary Software Engineering is oriented on practical things from the real word Understanding problems, providing software solutions SE uses methods and tools for solving the problems from different disciplines SE research Understanding principles Defining principle for solving the problems Developing methods and tools Software engineering and Scientific Methods Page 70, 3/12/2016