software design abstraction in “skilltree” technology introduction version 2.1 by avner ben 18...
TRANSCRIPT
SoftwareDesign Abstraction
In
“Skilltree” Technology
IntroductionVersion 2.1
by Avner Ben18 March 2012
(First version 24 April 2010)
15 March 2012 2Design Abstraction in Skilltree Tech. - Intro
Contents:
1. The design abstraction sequence2. Stage 1. To prepare the abstraction project3. Stage 2. To consume the code4. Stage 3. To elaborate embedded documentation5. Stage 4. To analyze design6. Stage 5. To improve the product7. About the “Skilltree” engine
15 March 2012 3Design Abstraction in Skilltree Tech. - Intro
The Design Abstraction Sequence
15 March 2012 4Design Abstraction in Skilltree Tech. - Intro
Abstraction sequence
# Stage Man Machine
1 To prepare the abstraction project Configures -
2 To consume the code Oversees Produces raw material
3 To elaborate embedded documentation Edits Processes
4 To analyze the design Analyzes Visualizes, reports
5 Optional: To improve the product Develops Generates starters
1 2 3 4 5
15 March 2012 5Design Abstraction in Skilltree Tech. - Intro
Required personnel
Function Affiliation Proficiency Responsibilities
Product Owner Site Language To present R.E. project requirements.To supply the R.E. project framework.To make requirements for next-gen. prod.
Abstraction Administrator
Service Language, R.E. tool
To configure the R.E. toolTo solve technical problems.
Abstraction Engineer Service Language ,R.E. tool ,Skilltree
To edit in-code documentation.To validate reconstructed design.
Domain Expert Site/service
Domain ,Language
To answer professional queries.To provide use cases. To supply knowhow to next-gen. product.
System Analyst Service Skilltree To review reconstructed design.
Designer/Developer
Site/service
Skilltree ,Language
To make next-generation design.To implement next-generation product.
15 March 2012 6Design Abstraction in Skilltree Tech. - Intro
Stage 1. To prepare the abstraction project
15 March 2012 7Design Abstraction in Skilltree Tech. - Intro
#1 To prepare the abstraction project
Design abstraction project preparation Function: Initial configuration of the design abstraction process.
Input: Output:
•Project file system. •Coding convention. •Current documentation style. •Basic configuration options. •Required standard design interfaces. •Misc. options.
•Abstraction Configuration: • File List. • Parsing options.
•Imported Design Interfaces: • Standard design interfaces.
Actors:
•Product Owner (buyer). Supplies code to consume. Facilitates abstraction process. Validates its artifacts •Abstraction Administrator (contractor). Configures abstraction project and sets it going.
15 March 2012 8Design Abstraction in Skilltree Tech. - Intro
#1 Preparation functions
1. To define the design abstraction file system. 1. To specify input files/folders. The abstraction engine parses only the files that it sees. It is not a C++ compiler!2. Optional: To specify the output folder (to avoid overwriting the originals).3. Optional: To avoid parsing files of type (e.g. “.c”). 4. Optional: To avoid parsing files/folders.5. Optional: To avoid parsing files in folders (e.g. “bin/”, “docs/”, “util/”).
2. To base-configure the design abstraction project.1. Optional: To configure basic macro parsing.
1. To pre-define macros. Abstraction does not do macro substitution. Macros are either treated as functions or ignored2. To know library/macro prefixes (to remove from revealed design names).
2. Optional: Configure method/field parsing.1. To ignore symbol qualifiers (e.g. “DllImport”).2. To know name abbreviations (e.g. “Matrix “-> “Mat”). Needed to extract design names from programmatic names.3. To avoid abstracting some functions and types (in addition to the standard library spec below)
3. Optional: To install imported design libraries. needed to identify container usage and to avoid abstracting standard functionality.
3. Optional: To add abstraction options. E.g. “produce Doxygen documentation”.
15 March 2012 9Design Abstraction in Skilltree Tech. - Intro
#1 Sample configuration; Skilltree design abstraction configuration file; Open CV open-source imaging library
[files]C:\cv\Source\include\C:\cv\Source\src\
[output]C:\cv\reverse
[excludePaths]C:\cv\Source\src\cvaux\C:\cv\Source\src\cxcore\C:\cv\Source\src\highgui\
[excludeFolders]bin\lost+found\docs\build\lib\data\
[macros]_MSC_VERWIN32__cplusplus__asmCV_CONTOUR_FIELDS
[libraryPrefixes]CvcvcxCV_CV
[methodQualifiers]cdeclWINAPI__inlineLIBSPECCV_INLINECV_EXPORTSCV_STDCALL
Etc.
15 March 2012 10Design Abstraction in Skilltree Tech. - Intro
Stage 2. To consume the code
15 March 2012 11Design Abstraction in Skilltree Tech. - Intro
#2 To consume the code
Source code consumption Function: Preliminary design abstraction parsing and auto-embedding pass.
Input: Output:•Initial configuration. •Abstraction Configuration:
• File list. • Parsing instructions.
•Source Code: • Pure code. • Original documentation.
•Abstraction Configuration: • Root program list.
•Documented Code: • Pure code copied. • Original documentation edited. • Default-Skilltree documentation. • Corrections.
15 March 2012 12Design Abstraction in Skilltree Tech. - Intro
#2 Consumption functions
1. Iterative: To attempt to parse the source code, giving first Skilltree-documented version.
1. Parse source code, which may or may not succeed. Study the result.2. Optional: Correct source code. Used as last resort when code is illegal or uses unacceptable style.3. Optional: Fine-tune abstraction configuration. Find obstruction and navigate parser around it.
1. To pre-define macros (referred in code but not defined in this scope).2. To avoid parsing files/folders (identified as irrelevant/offending).3. To ignore include dependencies (that create cyclic dependency somehow accepted by compilers).4. To configure method/field parsing (as used here).5. To know library/macro prefixes (used here).6. To know to handle macros – adds semicolon, hides invocation, throws exception, opens/closes block, etc.7. To define method/class-related macros (used here).
2. To constrain abstraction scope. Ignore unused logic, by adhering to call tree of some programs.
15 March 2012 13Design Abstraction in Skilltree Tech. - Intro
#2 Sample auto-documentation
bool DecisionMaker::findOut(const State& aState) { bool isStable = aState.isStable(); if (isStable) currentDecision.setStability(true);
Original source code
Machine-documented code
// to find out 5172// - Input: (formal) a State// - Output: (formal) a Boolean// - Use Case: Finding out 5172bool DecisionMaker::findOut(const State& aState) { // Message: “to tell if is stable 3265” bool isStable = aState.isStable(); // Message, Option: “to set stability 3266” if (isStable) currentDecision.setStability(true);
15 March 2012 14Design Abstraction in Skilltree Tech. - Intro
Stage 3. To elaborate embedded documentation
15 March 2012 15Design Abstraction in Skilltree Tech. - Intro
#3 To elaborate embedded documentation
15 March 2012 16Design Abstraction in Skilltree Tech. - Intro
#3 Input/output details
Source code documentation elaboration loop
Input: Output:
•Cyclic dependency solution. •Infrastructure identification. •Motivation. •Documented Code:
• Pure code. • Original documentation.
•Skilltree Database: • Components to export.
•Interim abstraction artifacts. •Abstraction Configuration:
• Excluded source files. •Documented Code:
• Pure code copied. • Original documentation edited. • Default-skilltree documentation.
•Imported Design Interfaces: • Imported design interfaces. • Abstracted Infrastructure interfaces.
•Skilltree Database: • Pure code copied. • Original documentation edited. • Default-skilltree documentation.
Actors:
•Abstraction Engineer (contractor). C++/Skilltree expert. Edits Skilltree in embedded documentation •Domain Expert (buyer). Developer familiar with problem. Explains the motivation for code complexity •Product Owner (buyer).
15 March 2012 17Design Abstraction in Skilltree Tech. - Intro
#3 Elaboration functions
1. Iterative: to elaborate embedded documentation one cycleuntil the complete design is abstracted.
1. To edit Skilltree-documented file1. Optional: To relate file to component.
1. Optional: To document component.2. Iterative: To edit documented element – entity, skill, association.3. Iterative: To document overlooked element – skill (macro), association (member datum).
2. Optional: To solve cyclic dependencies. Between entities and components.3. To separate infrastructure. Identify generic infrastructure and remove from main software product
1. To export components. Mark components as “exported”. Generate Skilltree interface files.2. Install imported design libraries. Install Skilltree interface files for parsing.
4. Parse the source code.
15 March 2012 18Design Abstraction in Skilltree Tech. - Intro
#3 Sample elaborated documentation
Human-edited code
// to find out about State// - Input: (formal) State to find out about// - Output: (formal) decision// - Use Case: Finding out about Statebool DecisionMaker::findOut(const State& aState) { // Message: to tell if State is stable bool isStable = aState.isStable(); // Message, Option: to set stability for Decision if (isStable) currentDecision.setStability(true);
15 March 2012 19Design Abstraction in Skilltree Tech. - Intro
#3 Sample Skilltree
ENTITY Decision Maker CAPABILITY to find out about State INPUT (FORMAL) State to find out about OUTPUT (FORMAL) decision IMPLEMENTATION Method SIGNATURE findOut(aState:const State&):boolBREAKDOWN OF CAPABILITY to find out about State USE CASE Finding out about State ACTOR Manager NEED to tell if State is stable (BY State) NEED (OPTION): to set stability for Decision (BY Decision)
#3 Sample layering
15 March 2012 21Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view - sequence
15 March 2012 22Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view - Pseudocode
15 March 2012 23Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view – Call tree
15 March 2012 24Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view – Programmer ref.
Component Decision MakingName: DecisionMaking.Namespace: Decision. Class DecisionMakerEntity: Decision Maker.
• Public method findOut - "to find out about State".Receives: aState:const State.Returns: Decision.Input: (formal) State to find out about.Output: (formal) Decision.Complexity: 3 reliances (2 messages), 4 nesting levels, 1 decision.
Class StateEntity: State.
• Public method isStable - "to tell if State is stable".Empty
Class DecisionEntity: Decision.
• Public method setStability - "to set stability for Decision".Empty
15 March 2012 25Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view – API
Class DecisionMaker Entity: Decision Maker. PublicfindOut
Skill: "to find out about State". Receives: aState:const State. Returns: Decision. Input: (formal) State to find out about. Output: (formal) Decision.
Synchronized.
Class State Entity: State. PublicisStable
Skill: "to tell if State is stable".
Class Decision Entity: Decision. PublicsetStability
Skill: "to set stability for Decision".
Component Decision MakingName: DecisionMaking.
15 March 2012 26Design Abstraction in Skilltree Tech. - Intro
#4 Sample design view – Class diagram
15 March 2012 27Design Abstraction in Skilltree Tech. - Intro
Stage 4. To analyze the design
15 March 2012 28Design Abstraction in Skilltree Tech. - Intro
#4 To analyze the design
Design analysis
Input: Output:
•Skilltree database. •Documented Code:
• SRS references. •SRS:
• Functional requirements.
•Design reports and charts. •Documented Code:
• Skill importance status. • Pure code copied. • Original documentation edited. • Default-Skilltree documentation. • Refactoring/redesign suggestions.
•Skilltree Database: • Pure code copied. • Original documentation edited. • Default-Skilltree documentation.
#4 Analysis functions
#4 Sample Skilltree with referencesENTITY Decision Maker IMPLEMENTATION CLASS NAME DecisionMaker REFERENCE Automatic Decision Maker SRS 3. Automatic Decision Making CAPABILITY to find out about State USAGE CONTRACT INPUT (FORMAL) State to find out about OUTPUT (FORMAL) Decision IMPLEMENTATION METHOD SIGNATURE findOut(aState:const State&) CONSTRAINT The decision maker must be capable of handling up to 500 decisions per ms, of which 100 may come in parallel CATEGORY Performance REFERENCE Automatic Decision Maker SRS 1. performance
ENTITY State IMPLEMENTATION CLASS NAME State CAPABILITY to tell if State is stable IMPLEMENTATION METHOD SIGNATURE isStable() REQUIRED NOT
ENTITY Decision IMPLEMENTATION CLASS NAME Decision CAPABILITY to set stability for Decision IMPLEMENTATION METHOD SIGNATURE setStability() CONSTRAINT stability must not exceed that defined DO587/A(14) CATEGORY DO Conformance REFERENCE Automatic Decision Maker SRS 7. Standard Compliance
#4 Reference report
Automatic Decision Maker SRS 1. performance
- Constraint: The decision maker must be capable of handling up to 500 decisions per ms, of which 100 may come in parallel
3. Automatic Decision Making - Entity: Decision Maker
7. Standard Compliance - Constraint: stability must not exceed that defined DO587/A(14)
#4 Constraint report
DO Conformance: "Stability must not exceed that defined in DO587/A(14)"
o Capability: to set stability for Decision o Ref: Automatic Decision Maker SRS 7. Standard Compliance
Performance: "The decision maker must be capable of handling up to 500
decisions per ms, of which 100 may come in parallel" o Capability: to find out about State o Ref: Automatic Decision Maker SRS 1. performance
15 March 2012 33Design Abstraction in Skilltree Tech. - Intro
Stage 5. To improve the product
15 March 2012 34Design Abstraction in Skilltree Tech. - Intro
#5 Sample code starter
// to find out about State.// - Input: (FORMAL) State to find out about.// - Output: (FORMAL) Decision.// - Use Case: Finding out about State.bool DecisionMaker::findOut(const State& aState) {
// Message: "to tell if State is stable"aBool = aState.isStable();// Message, OPTION: “to set stability for Decision”if (/* unknown condition */) {
aDecision.setStability();}
}
15 March 2012 35Design Abstraction in Skilltree Tech. - Intro
More Aboutthe “Skilltree” Engine
15 March 2012 36Design Abstraction in Skilltree Tech. - Intro
Skilltree - VHLL
VHLL “Very High-Level Language” (Rather than “CASE” tool)
Written specification, Machine-generated diagrams.
15 March 2012 37Design Abstraction in Skilltree Tech. - Intro
Skilltree - paradigm
“Programming without programming” paradigm.Machine-readable,
object-orientedPseudocode.
15 March 2012 38Design Abstraction in Skilltree Tech. - Intro
Skilltree - future
Visual editing(Under construction)
15 March 2012 39Design Abstraction in Skilltree Tech. - Intro
Skilltree - history
In commercial use since 2005.In conception since 1994.
Under construction, but fairly robust.Current version 0.6.73
15 March 2012 40Design Abstraction in Skilltree Tech. - Intro
User testimony
”We found the following to be beneficial to the project, facilitating the completion of its first stage successfully and on schedule:
The external monitoring of the development process by your professional supervision was a key issue in the success of the first stage of the project.
Upgrading the workforce to full object-oriented programming was achieved within a short time, using the Skilltree design specification language as high-level replacement for C++.
Design completeness was promoted by using the Skilltree compiler to produce design documentation, analysis and cross-references.
The work plan was validated, using the Skilltree compiler to produce a schedule starter.
Compliance of implementation to requirements was maintained to a fair degree by using the Skilltree compiler to generate code starters in C++. The logic in these code starters has not been changed significantly during the implementation and whatever few changes were made were easily reverse-engineered to the design.”
15 March 2012 41Design Abstraction in Skilltree Tech. - Intro
Thank you for your attention!