Course 3 – 22 October 2012 Adrian Iftene [email protected]
Recapitulation
◦ Swebok
◦ SCM – Revision control
Software Engineering Tools
Model Driven Development
◦ Model Driven Architecture
◦ Agile MDD
Test Driven Development
Domain Specific Language
◦ Eclipse Modeling Framework
Software Engineering Body of Knowledge
Book’s authors Alain Abran, James W. Moore, 2004
10 Knowledge Areas:
◦ Software configuration management
◦ Software engineering management
◦ Software engineering process
◦ Software engineering tools and methods
The management of changes to documents, programs, and other information stored as computer files
Version control systems: Microsoft Word,
OpenOffice.org, Drupal, Joomla, WordPress, MediaWiki
Vocabulary: trunk, branch, change, checkout, checkin, merge, conflict
Requirements
Software design
Software construction
Software testing
Editors, Compilers, Interpreters, Debuggers
QA Center Performance, QuickTest Professional (QTP), WebLoad Analyzer, Unified TestPro, IBM Rational Tester
Recapitulation
◦ Swebok
◦ SCM – Revision control
Software Engineering Tools
Model Driven Development
◦ Model Driven Architecture
◦ Agile MDD
Test Driven Development
Domain Specific Language
◦ Eclipse Modeling Framework
Model Driven Development (MDD) is a paradigm for
writing and implementing computer programs quickly, effectively and at minimum cost
MDD is an approach to software development where extensive models are created before source code is written
A primary example of MDD is the Object Management Group (OMG)’s Model Driven Architecture (MDA)
standard
MDA is a software design approach for the development of software systems. It provides a set of guidelines for the
structuring of specifications, which are expressed as models
MDA is a kind of domain engineering, and supports model-driven engineering of software systems. It was
launched by the Object Management Group (OMG) in 2001
MDA approach defines system functionality using a platform-independent model (PIM) using an appropriate domain-specific language (DSL)
PIM is a model of a software system or business system, that is
independent of the specific technological platform used to implement it
DSL is a programming language or specification language dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique
PSM - the code is generated by transforming the PIM model into a platform specific model (PSM)
OMG focuses Model-driven architecture on forward engineering
One of the main aims of the MDA is to separate
design from architecture (allows system developers to choose from the best and most fitting in both
domains)
The design addresses the functional (use case)
requirements while architecture provides the
infrastructure
Creation Tool: used to elicit initial models
Analysis Tool: used to check models for completeness, inconsistencies, or error and warning conditions
Transformation Tool: used to transform models into other models
Composition Tool: used to compose several source models
Test Tool: used to “test” models
Simulation Tool: used to simulate the execution of a system
Metadata Management Tool: intended to handle the general relations between different models
Reverse Engineering Tool: intended to transform particular legacy or information artifact portfolios into full-fledged models
CA Gen is a powerful model-driven environment that will enable your organization to speed delivery and maintenance (platforms:
z/OS (CICS and IMS), UNIX, Linux, Windows, .NET and J2EE)
AMDD is the agile version of Model Driven Development (MDD)
MDD: The difference with AMDD is that instead of creating extensive models before writing
source code you instead create agile models which are just barely good enough that drive your overall development efforts
AMDD is a critical strategy for scaling agile
software development beyond the small, co-
located team approach that we saw during the
first stage of agile adoption
Initial Requirements Modeling – identify high-level requirements and the scope of the release (what you think the system should do). We can use:
◦ a form of usage model (how users will work with the system),
◦ an initial domain model (identifies fundamental business entity types and the relationships between them)
◦ an initial user interface model (UI and usability issues)
Initial Architecture Modeling - identify an
architecture that has a good chance of working
Thinking Through What You’ll Do This Iteration
Recapitulation
◦ Swebok
◦ SCM – Revision control
Software Engineering Tools
Model Driven Development
◦ Model Driven Architecture
◦ Agile MDD
Test Driven Development
Domain Specific Language
◦ Eclipse Modeling Framework
When you code, alternate these activities:
◦ add a test, get it to fail, and write code to pass the test
◦ remove duplication
This inner loop pumps the outer loops of Extreme Programming – Continuous Integration, Daily
Deployment, Frequent Releases, and Steering Software Projects
1. Add a test
2. Run all tests and see if the new one fails
3. Write some code 4. Run the automated
tests and see them succeed
5. Refactor code Repeat
Benefits:
◦ programmers that wrote more tests tended to be more productive
◦ It allows a programmer to focus on the task at hand as the first goal is to make the test pass
◦ total code implementation time is typically shorter
◦ the code is modularized, flexible, and extensible
Vulnerabilities
◦ is difficult to use in situations where full functional tests are required to determine success or failure
◦ The high number of passing unit tests may bring a false sense of security and productivity
Recapitulation
◦ Swebok
◦ SCM – Revision control
Software Engineering Tools
Model Driven Development
◦ Model Driven Architecture
◦ Agile MDD
Test Driven Development
Domain Specific Language
◦ Eclipse Modeling Framework
DSL - is a programming language or specification
language dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique
Creating a domain-specific language (with software to support it) can be worthwhile if the language allows a particular type of problems or solutions to them to be expressed more clearly than pre-existing languages would allow, and the type of problem in question
reappears sufficiently often
The opposite is:
◦ a general-purpose programming language, such as C or Java,
◦ or a general-purpose modeling language such as UML
27
Logo for children
Spreadsheet formulas and macros
SQL for relational database queries
LINQ - a series of language extensions
YACC grammars for creating parsers
Regular expressions for specifying lexers
◦ \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
◦ <TAG\b[^>]*>(.*?)</TAG>
◦ ^(19|20)\d\d[- \.](0[1-9]|1[012])[- \.](0[1-9]|[12][0- 9]|3[01])$
The Generic Eclipse Modeling System for creating
diagramming languages
In design and implementation
◦ Visual diagramming language, such as those created by the Generic Eclipse Modeling System
◦ Programmatic abstractions, such as the Eclipse Modeling Framework
Programming tools
◦ functional language XSLT, specifically designed for transforming one XML graph into another
Unix shell scripts - a domain-specific language for data organization
MediaWiki templates - support the creation of
page templates and inclusion by reference
Metacompilers - useful for generating parsers and code generators for domain specific languages
TexLanguage - a typesetting language developed by Donald Knuth
◦ LaTex, a macro package for Tex which provides higher-level abstractions (though still for general-purpose document
formatting)
◦ BibTex, a macro package for Tex which specializes in handling citations/bibliographies for scholarly works
• Some of the advantages:
• Domain experts can understand, validate, modify, and develop DSL programs
• Self-documenting code
• Enhance quality, productivity, reliability, maintainability, portability and reusability
• Domain-specific languages allow validation at the domain level
• Some of the disadvantages:
• Cost of learning a new language vs. its limited applicability
• Cost of designing, implementing, and maintaining a DSL
• Finding, setting, and maintaining proper scope
• Difficulty of balancing trade-offs between domain-specificity and general-purpose programming language constructs
• Loss of processor efficiency
34
EMF started out as an implementation of the
Object Management Group’s (OMG) Meta Object Facility (MOF) specification
EMF is a Java open source framework and code- generation facility for building tools and other applications based on a structured model
EMF provides an efficient reflective API and
allows you to work with dynamic, non-generated,
models
EMF can generate Java source code that will allow you to create, query, update, serialize, deserialize, validate, and track changes to instances of your models
EMF supports generating code from XML
Schema, UML class diagrams (Rational Rose or
UML2), and annotated Java interfaces
Model generated looks like:
EMF Updates sites:
http://download.eclipse.org/modeling/emf/updates/releases/
Eclipse -> Help -> Install new software
Help -> About Eclipse -> Installation details -> Plug-ins
http://help.eclipse.org/ganymede/topic/org.eclipse.emf.doc/tut orials/clibmod/library.mdl (save the file to your computer)
(object Class "Book"
quid "40C81E700047"
class_attributes (list class_attribute_list (object ClassAttribute "title"
quid "40C81E770119"
type "String") (object ClassAttribute "pages"
quid "40C81E7E03A3"
type "int"
initv "100") (object ClassAttribute "category"
quid "40C81E890344"
type "BookCategory")))
Eclipse 3.7 (Indigo): http://www.eclipse.org/indigo/
Eclipse EMF Tutorial:
http://www.vogella.de/articles/EclipseEMF/article.html
Swebok Home: http://www.swebok.org/
Revision Control: http://en.wikipedia.org/wiki/Revision_Control
SCM: http://en.wikipedia.org/wiki/Software_configuration_management
Software testing tools: http://www.docstoc.com/docs/82854752/Software- Testing-Tools-for-Software-Test-Automation
MDA: http://en.wikipedia.org/wiki/Model-driven_architecture
CA Gen: http://www.ca.com/us/products/detail/ca-gen.aspx
AMDD: http://www.agilemodeling.com/essays/amdd.htm
TDD: http://c2.com/cgi/wiki?TestDrivenDevelopment, http://en.wikipedia.org/wiki/Test-driven_development
EMF: http://www.eclipse.org/modeling/emf/, http://www.devx.com/Java/Article/29093
Generating an EMF Model:
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/referen ces/overview/EMF.html
http://www.eclipse.org/modeling/emf/docs/2.x/tutorials/clibmod/clibmod_emf 2.0.html
Eclipse EMF Tutorial: http://www.vogella.de/articles/EclipseEMF/article.html
50
Swebok Book:
http://se.sjtu.edu.cn/sites/se/gb/CCSE/Swebok_
Ironman_June_23_%202004.pdf