cb6d2fe6a1f20bfe748bbd33d81124c0.ppt
- Количество слайдов: 21
Advanced software engineering in simulation development and applications Maria Grazia Pia INFN Genova, Italy Maria. Grazia. Pia@cern. ch Maria Grazia Pia, INFN Genova
The lesson learned. . . Courtesy of NASA/CXC/SAO Maria Grazia Pia, INFN Genova
Why software engineering in experimental physics? ] Software engineering is somewhat new to the HEP/astroparticle environment l ] other engineering branches more consolidated in this environment (mechanics, electronics, accelerators etc. ) Benefits derive from a rigorous approach to software l l l the lesson can be learned from the world of software professionals! even the most talented professionals need an organized environment to do cooperative work advanced technology cannot be fully effective without an organizational framework Software Engineering plays a fundamental role in Geant 4 Software process SPI Maria Grazia Pia, INFN Genova User requirements OOAD Quality Assurance
25 years Start SPS 1976 Maria Grazia Pia, INFN Genova W and Z observed 1983 Start LEP 1989 WWW End LEP 2000
Evolution of software ] 10 years mean in every domain (HW, SW, OS) l l ] ~12 market cycles 1 revolution … and the trend towards a greater variability …together with the evolution of requirements! Consequences l l Today’s software will not be the final one We should foresee change Maria Grazia Pia, INFN Genova
Object Oriented technology ] ] OO technology is built upon a sound engineering foundation, whose elements are called the object model The object model encompasses the principles of l abstraction l encapsulation l modularity l hierarchy l typing l concurrency l persistence brought together in a synergistic way Geant 4 is based on Object Oriented technology Maria Grazia Pia, INFN Genova
The dream of any software… ] The Open Closed Principle Open for extension, Closed for modification l l l A software module that is designed to be reusable, maintainable and robust must be extensible without requiring modification new features are added by adding new code, rather than by changing old, already working, code The primary mechanisms behind are abstraction and polymorphism Maria Grazia Pia, INFN Genova
ADT (Interface) ] Abstract Data Type: it is a class that defines only methods, that must be implemented by derived classes ] No implementation constraint Depending on the implementation language, it can be ] l l ] High flexibility l ] C++ pure virtual function Java Interfaces Many different implementations derived from, and interchangeable with, the ADT Minimize the coupling between components l l Each component can evolve independently Reduce the chain of dependencies Maria Grazia Pia, INFN Genova
Large scale software ] Large scale software systems l l l Well defined and homogeneous structure (architecture) Partition into manageable units (components) Communication between components defined in a unique way (interfaces) Maria Grazia Pia, INFN Genova
The Toolkit approach A toolkit is a set of compatible components l l l l each component is specialised for a specific functionality each component can be refined independently to a great detail components can be integrated at any degree of complexity components can work together to handle inter-connected domains it is easy to provide (and use) alternative components the simulation application can be customised by the user according to his/her needs maintenance and evolution - both of the components and of the user application - is greatly facilitated . . . but what is the price to pay? l l the user is invested of a greater responsibility he/she must critically evaluate and decide what he/she needs and wants to use Maria Grazia Pia, INFN Genova
OO technology in Geant 4 OO design fundamental for distributed parallel approach every part can be developed, refined, maintained independently l Problem domain decomposition and OOAD result into a unidirectional dependency of class categories l Transparency decoupling from implementation Flexibility alternative models and implementations Interface to external software, without dependencies databases for persistency visualisation libraries tools for UI etc. Maria Grazia Pia, INFN Genova è Open to evolution l l extensibility, implementation of new models and algorithms without interfering with existing software the user can extend the toolkit with his/her model and data
The benefits of software engineering The goal: producing better software at lower cost, within cost predictable resource allocations and time estimates, and happier estimates users of the software Three key components: v § the people involved § the organization of the development process § the technology used The way to progress is to study and improve the way software is produced • better technology only helps once the organizational framework is set • there is evidence that going for new technology instead of improving the process can make things worst v The practices of SPI are well established, and have been applied in a large number of organizations for several years • the results prove that the economical benefits are largely worth the investment • early defect detection, time to market, and quality also improve, to the point that the return on investment for SPI is about 500% Maria Grazia Pia, INFN Genova
Various phases: § § § User Requirements definition Software Requirements definition Architectural Design Detailed Design and construction Delivery to the user Operations ] Frequently the tasks of different life cycle phases are performed somewhat in parallel to consider them disjoint in time is a simplification ] It is however important l to distinguish them logically l to identify documents that are the outcome of the various phases Maria Grazia Pia, INFN Genova Software life-cycle
The software process It is the set of actions, tasks and procedures involved in producing a software system, through its life-cycle ] ] Complex domain, evolving, with many types of models available; some examples of software process models are, for instance: The Waterfall model l l ] analysis design coding each phase starts following the completion of the previous one The Iterative Incremental Development model l cycles of analysis design coding, with incremental refinement Maria Grazia Pia, INFN Genova
Software process standards ] Capability Maturity Model l ] ] Software Engineering Institute SPICE, ISO 15504 l the path to an international standard PSS-05, ECSS l • ESA Process categories Primary life-cycle of software development Supporting life-cycle Management process Organizational life-cycle User-supplier processes Maria Grazia Pia, INFN Genova • • • • Development or Engineering processes: system and software requirements analysis, software design, software construction, software integration and unit testing, software maintenance Documentation Configuration and Change Management Problem Resolution Quality Assurance and Measurement System Testing, Acceptance and Releasing Verification and Validation Reviews, Audits and Joint Reviews Project tasks Management Improvement Process Establishment Human resource Management Infrastructure User Support, Distribution etc.
The software process in Geant 4 A challenge: • a large international collaboration • complex software • mature categories in production and maintenance mode as well as categories in full development • sensitive and mission-critical user applications • product with a long life-time OOAD ] Spiral-type life-cycle model adopted in most domains l both iterative and incremental testing implementation v. Software Process Improvement • understand, determine and propose procedures to software development and maintenance • gradual process, life-cycle driven • regular assessment, according to the ISO 15504 model Maria Grazia Pia, INFN Genova
Requirements are the quantifiable and verifiable l behaviours that a system must possess l constraints that a system must work within User requirements l this phase defines the scope of the system Software requirements l l ] this is the analysis phase of a software project builds a model describing what the software has to do (not how to do it) Requirements are subject to evolution in the lifetime of a software project! è ability to cope with the evolution of the requirements Maria Grazia Pia, INFN Genova
UR: capture Various methodologies adopted ] Elicitation through interviews and surveys l Useful to ensure that UR are complete and there is wide agreement ] Analysis of existing Monte Carlo codes ] Study of past and current experiments ] Prototyping ] Joint workshops with user groups l ] Direct requests from users to WG coordinators or members ] Use cases ] l Useful especially if requirements are unclear or incomplete Prototype based on tentative requirements, then explore what is really wanted The requirements derive from many sources, in diverse domains l HEP, astrophysics, space, medical etc. User requirements evolve …and we should be able to cope with their evolution! Maria Grazia Pia, INFN Genova
OOAD Spiral approach Booch methodology for OOAD UML notation Rational Rose CASE tool Maria Grazia Pia, INFN Genova The life-cycle model adopted for most domains in Geant 4 is both iterative and incremental especially relevant in the physics domain! – has been chosen as the common language for documentation of designs and internal design reviews – old documents in Booch notation are being progressively updated and converted to UML – extensively used for the initial generation of design documents – where required, also for reverse engineering (Hadronic Physics, Standard EM, Low. E EM initially)
Quality Assurance Extensive use of QA systems in Geant 4 fundamental for a toolkit of wide public use Commercial tools l Insure++, Code. Wizard, Workshop etc. C++ coding guidelines l scripts to verify their applications automatically Code inspections l l within working groups and across groups Walk-throughs with specialized tools for monitoring against violations of coding rules Checks on run-time memory management Checks for violations of the dependency structure of categories Performance benchmarks and monitoring Maria Grazia Pia, INFN Genova Testing Unit testing l in most cases down to class level granularity Integration testing l sets of logically connected classes Test-bench for each category l eg. : test-suite of 375 tests for hadronic physics parameterised models System testing l exercising all Geant 4 functionalities in realistic set-ups Physics testing l comparisons with experimental data
Risk factors Maturity of the experimental community? l l l to appreciate the need of a new software environment to work in a simulation environment based on advanced software engineering to invest in learning new technologies Maria Grazia Pia, INFN Genova