390 likes | 479 Views
Discover the Modeler in You! – Using Models to Engineer Software. ______________________ Devon M. Simmonds CIS 2046 Computer Science Department University of North Carolina Wilmington simmondsd[@]uncw.edu _____________________________________________________________. Outline.
E N D
Discover the Modeler in You! – Using Models to Engineer Software ______________________ Devon M. Simmonds CIS 2046 Computer Science Department University of North Carolina Wilmington simmondsd[@]uncw.edu _____________________________________________________________
Outline • What is computer science • Problems with solving computing problems • What is software engineering • Engineering software using models
Motivation • Computer science - solving problems with the aid of a computer • Computers are everywhere!
Motivation • And there are good computer jokes! “Witness testifies on Software Security”
Motivation • And there are good computer jokes! “Witness testifies on Software Speed”
The communication problem ??? • Solving problems with the aid of a computer • instruct the computer to do what we want ? • Humans communicate through naturallanguages: English, Spanish, French, etc. • The computer has its own language! • Bits and bytes, 0’s and 1’s – machine language • So humans and computers speak different languages! • 1st Problem: • How do we give instructions to a computer to do what we want it to do if we speak different languages?
??? Motivation Employ an Interpreter • What language should the interpreter speak? • Human language • Machine language • Interpreter translates human language into machine language • 2nd Problem: • Human language is ambiguous!
Motivation Programming language Machine language • Solution to 2nd Problem: • Since human language is ambiguous: • Create a language for writing instructionsfor a computer – programming language • Interpreter translates instructions written in a programming language into machine code. • The process of writing instructions for a computer to execute is called programming. • The written instructions is called a program. Interpreter
Writing Programs PEOPLE COMPUTER Communication? Programming language Machine language • Large software systems: 4 x 106 – 100 x 106
ENIAC I - 1946 Hardware vs. Software • The early decades (40s – 60s) • Main focus of attention - computer hardware. • Building faster, simpler, and, more efficient machines. Modern Supercomputer
Software problems • Inability to predict time, effort, and costs. • Projects were often late and ran over budget because there was little experience on which to base predictions • Inability to deliver quality software. • Customers and developers accept that software will always have defects • Software products are released with known “list of bugs” • Lack of enough competent software developers
Wilmington network A Chapel Hill Charlotte C B Rising software complexity! • Complex, critical systems are pervasive! • Quality of life issues • Consequences of errors are far-reaching • Consequences of errors are far-reaching • Consequences of errors are far-reaching
Software Development Mishap:Long-distance phone traffic routing …switch (caseIndex) {case‘A’: route = routeA; … break; …case‘M’: route = routeM;case‘N’: route = routeN; … break;…} Missing break statement Result:Loss of long-distance service in NE USA Cost of approx. $800 M (1990)
Software Development Mishap • Problem: • Patients were given massive overdoses of radiation • Cause: • Safety of software not considered • Software reused without testing • No architectural model. • Result:at least 5 deaths! The radiation therapy: Therac 25 Machine
Building software pyramids • Building complex software with current tools is akin to building pyramids in ancient Egypt • Or cathedrals in medieval times…
Engineering Software • Computer science - solving problems with the aid of a computer • Artificial intelligence • Database management systems • Distributed systems • Computer graphics • Operating systems • Software engineering
What is engineering? • Engineering is … • The application of scientific principles and methods to the construction of useful structures & machines • Examples • Mechanical engineering • Civil engineering • Chemical engineering • Electrical engineering • Nuclear engineering • Aeronautical engineering
What is Software Engineering (SE)? • Software Engineering is concerned with development of complex systems that are built by teams of developers. • SE techniques are not intended for small problems (e.g., writing a program for sorting a list of numbers). • On the other hand, SE builds upon programming techniques; a good software engineer must also be a good programmer. • SE research focuses on developing mechanisms and methods that help developers manage system complexity.
What is SE? • The establishment and use of sound engineering principles in order to obtain economically software that is reliable and works efficiently on real machines. Bauer/Pressman
Software Design Requirements Analysis Implementation Systems Engineering Testing Deployment Evolution The Software Engineering Lifecycle • The process/activities of developing and evolving software
The Software Engineering Lifecycle • Systems Engineering • Identify needs/problems • Allocation of roles • Hardware • Procedures • Software • Feasibility studies Software Design Requirements Analysis Implementation Systems Engineering Testing Deployment Evolution
The Software Engineering Lifecycle • Requirements Analysis • Define goals, objectives, features of target software Software Design Requirements Analysis Implementation Systems Engineering • Identify needs, problems and allocate roles Testing Deployment Evolution
The Software Engineering Lifecycle • Software design • Creating a blueprint for building the software • Architectural design • Subsystem design • Detailed design • Procedural Design • User Interface Design • Database Design • Data Structures Design • Test case design Software Design Requirements Analysis Implementation Systems Engineering • Define software features • Identify needs, problems and allocate roles Testing Deployment Evolution
The Software Engineering Lifecycle • Implementation • Creating the finished product – the program • Coding • Writing code for the classes and operations • Generate object code • Create Test cases • Create user manuals Software Design Requirements Analysis Implementation • Create blueprint Systems Engineering • Define software features • Identify needs, problems and allocate roles Testing Deployment Evolution
The Software Engineering Lifecycle • Testing • Determining if the software has errors/fulfils its requirements • Test planning • Unit testing • Subsystem testing • Integration testing • Regression testing • Test case design Software Design • Create code Requirements Analysis Implementation • Create blueprint Systems Engineering • Define software features • Identify needs, problems and allocate roles Testing Deployment Evolution
The Software Engineering Lifecycle • Deployment • Making the software available for use • Deployment/installation planning • Develop documentation • Hardware configuration • Installation • Software distribution • Training Software Design • Create code Requirements Analysis Implementation • Create blueprint Systems Engineering • Define software features • Identify needs, problems and allocate roles Testing Deployment • Uncovering errors Evolution
The Software Engineering Lifecycle • Evolution • Managing the software • Configuration management • Controlling change as software evolves • Technical support • Software lifecycle activities Software Design • Create code Requirements Analysis Implementation • Create blueprint Systems Engineering • Define software features • Identify needs, problems and allocate roles Testing Deployment • Uncover errors Evolution • Make software available for use
The Software Lifecycle • General activities • Project management • Software estimation & scheduling • Training • Configuration management Software Design Requirements Analysis Implementation Systems Engineering Testing Deployment Evolution
1.1 1.2 2.0 4.0 1.3 2.1 2.2 1.4 3.0 1.5 3.1 Configuration Management in Action 1.0
A - Making a V-cut. • B - Receiving Inside Hand-off. Roy Williams Models in Engineering • Benefits of models • Help us understand and manage complex systems • Communicate understanding • Drive implementation • Save resources Engineering is aModel-Driven Discipline!
Model Driven Architecture (MDA) • An initiative to address pervasive middleware features [From OMG website]
CompileModel CreateModel Need modelcompiler Model of the Program A C B Binary instructions Code-centric Development Model-Driven Development (MDD) Using programminglanguage Manually Create Code • Realizing the dream – MDD challenges • Abstraction: specifying models • Model Transformation: creating new models from existing models • Code Generation: generating code from models, i.e. compiling models • Managing middleware: supporting model portability, reusability, etc. • Analysis: determining properties of models Code Using modelinglanguage CompileCode
CreateModel Model A Model B A M A K C C B B P Binary instructions Model-Driven Development (MDD) CompileModel Code class Student { private: int age; char name[40]; Address address; public: void move(); void speak(); } CompileCode
Application program Middleware Transaction management Fault tolerance Security Application program Application program Naming Concurrency Operating System Operating System Replication Query Computer Hardware Computer Hardware Event Quality of service MDD & Middleware • Many middleware technologies • .Net, EJB, SOAP, COM, CORBA, Jini, • Software require many middleware technologies • Middleware technologies evolve • Changing Middleware in code is difficult
Automation: creating models Matlab Simulimk Modeling Languages Together
Bridgepoint codegen Model B M A C K B P Code Generation class Department { private: char name[40]; Student csc[100]; public: void manageStudents(){ csc[i]->register(); … csc[i]->grade(); … csc[i]->graduate(); }} OptimalJ
Qu es ti ons? ______________________ Devon M. Simmonds Computer Science Department University of North Carolina Wilmington _____________________________________________________________