Friday 16 September 2011

SASSY - Increment #3

The aim of this round of development is to tidy up some of the rough edges
from the first round. Our first cut was done with the aim of getting
something done from which we could base the subsequent development. In the
rush it was easier to copy and paste similar code, and there were a few
bugs in the way diagrams were displayed.


To organise the work I used the Mantis bug tracker program and noted down
all the things that needed attention. Again, for this increment the aim
was not to extend the functionality, but rather to focus on the quality.


The following bugs were addressed:

Empty boxes in diagrams
The diagram building code got additional checks to ensure the diagrams were OK.
Diagrams the wrong size
The temporary file name given to the diagram's eps text turned out to be not unique. This resulted in some diagrams being scaled twice, and others not at all. A better file naming algorithm cured the problem.
Hyperlinks flowed into the margins
The LaTeX processor in dvips was not able to handle hyper-links adequately. I found, and installed a newer package, called dvipdfm, that could correctly break a hyper-link.
Table of Figures
The architecture document has a lot of diagrams, and it really needed a table of figures to appear after the table of contents. A few changes to the boiler-plate had that included easily.
Formatting Issues
Some paragraphs needed to be indented, so I constructed a LaTeX command to provide the required formatting. Also fixed the boiler-plate for things like the revision history and copyright notice. Finally I added a new SASSY logo.
Quality Attributes
The Requirements document was listing the quality requirements correctly, but these were worded in a way that referenced the corresponding quality attribute, which was not being shown. Some modifications to the code soon fixed that issue, and now the requirements are quite readable.
Requirement Priorities
I had put some support in for handling the priority of a requirement but it was unused. This meant that you could not separate the mandatory from the important or the "nice to have" requirements. I added a classification to each requirement, and added the code to display this information in the generated requirements document.
Code Refactoring
Common code was separated out, paramaterised where necessary, and placed into the appropriate parent classes.

Conclusion

The programs now form a solid basis for the rest of the project. We have
something from which we can build on and which will usually be in a working
state if we need to show it off.


My main concern is that the code to generate the documents is too
dependent on the structure of the ontologies. This is something we will
address in the next increment where that aim is to incorporate SPARQL-DL
into the design.



Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Saturday 20 August 2011

SASSY - The First Cut


In the previous round of development we demonstrated that it was possible
to generate a document from the content of an ontology. Now its time to do
an initial version of SASSY with a useful amount of functionality. The project
for this will be SASSY itself.


Requirements

The first step is to document the requirements. Eventually we will do this
using SASSY, but this time we will have to fall back to using a word processor.
The main requirements are:

  • The system shall enable the user to maintain a set of reference ontologies.
  • The system shall allow the user to maintain a set of project specific
    ontologies.
  • The system shall allow the user to generate documents based on the reference
    ontologies.
  • The system shall allow the user to generate documents based on the project's
    ontologies

Architecture

The system will use Protege to create the ontologies and save them to an
RDF/XML database. We access this database using the Java OWLAPI library,
and connect to the library using ICE from a C++ program. To keep things
simple, that C++ program is a command line program that accepts commands
on its input to perform various actions. A small GUI program, using Qt,
provides a graphical interface that runs the command line program when it
starts and passes the user commands to it. The GUI will have a tool bar
for launching Protege, a document viewer, the ontology viewer we built
previously, and Firefox for viewing help documentation.


In the final design we will have components for logging and tracing the
code, as well as administering the server processes. For this increment
we will not bother with this functionality.


User Interface Design

The Qt based GUI will have a tool bar and menus and a set of tabs with one
for each major action: Quality Attributes, Requirements, Data Dictionary
and Architecture. Other tabs will be added later for tracing and Configuration
Management. Each tab will allow the user to set parameters for the particular
action. Eventually we will get these actions from a configuration file and
the ontologies, but for this increment we will just hard code it.


Design

The ICE interface specification, for this cut, will have a separate module for
each action. Later we will re-factor the common components into a base module.


The Java code will have a server class that allows clients to connect using
the ICE protocol. For now we will just use a hard coded port for the comms.
Each ICE module results in a collection of Java classes that are automatically
generated from the ICE interface definition. We also need to create the server
implementation classes that use the OWLAPI to access the ontology databases.
It seemed prudent to keep the generated code separate from the hand built stuff,
and fortunately Eclipse is able to handle building in such a structure.


The C++ code for the ICE interface is accessed through an abstract class. This
keeps the implementation out of the remainder of the code, which does not even
need to include the ICE related header files.


The core set of classes manage the process, including interpreting the commands
from the GUI and running the filter programs that convert the LaTeX into PDF.
This core includes some base classes from which action specific classes are
derived. These include document and diagram modelling classes which builds an
internal representation of the document, and a formatting class which converts
the model into LaTeX.


Another set of classes handle the details of documents, sections, paragraphs
and diagrams. I added the ability to use hyper-links in the PDF which meant
that I had to design a mechanism to allow attributes to be assigned to the
text. For now it only handles the hyper-link references and targets, but it
could be extended to other attributes such as colour, underlining, italics
fonts, etc.


Development

For this first rough cut the focus is to get something working. Each action
was developed without much thought to the others, apart from finding bits of
code that could be copied. The result will need a fair amount of re-factoring
and cleaning up before its used as the basis for subsequent increments.


The Quality Attribute section was the simplest since it is reporting an
ontology that will just be used as a reference. Hence the code can have some
knowledge of the ontology hard coded into it. The focus was on developing
the best techniques for getting and formatting the data. A final step was to
add some diagrams.


The Requirements section was a little more complex in that the ontology
would mostly be unknown. It also used data relationships which required some
additional research to find the best way to access the data.


The Data Dictionary section built further on creating an ontology dependent
document, and added cross references in the form of hyperlinks to the PDF.


Finally the Architecture section could build on all these techniques to
create an initial architecture document. For this cut I restricted it to just
the conceptual view and the logical view of components. It became evident
that creating nice diagrams was still going to be complex, so this will need
to be one focus for the next increment.


Conclusion

It became clear during the architecture development that building the
document was too dependent on the content of the ontology. For the simpler
documents this would be OK since we could control what relationships would
be used. However, for the a more general ontology this starts to become
problematic. Also it bacame evident that some way to generate new views of
the data would be necessary. A little research found SPARQL-DL which should
allow us to build a system where new views can be added through the
configuration for SASSY.


The next increment will tidy up some of the rough edges, such as diagram
scaling and orientation, and re-factor the code so that it is a bit more
maintainable.












Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Thursday 28 July 2011

SASSY - Proof of Concept

The first development cycle for the project is designed to determine if the
concept is even possible. To demonstrate this we will build a small application
that takes an ontology prepared by Protege and attempt to generate LaTeX and
then PDF.

For my test data I built an ontology of quality attributes. Every term like
maintainability or performance that was mentioned in the literature was dumped
into this ontology, along with a short description of what it means. This will
later be enhanced to incorporate the various quality frameworks that
researchers have developed to try and bring some structure to this collection.

I then started by using GCJ to compile the Java OWLAPI library so that it could
be linked to my C++ code. After a bit of hacking the Ant build script a
successful build was created. I was able to call this from C++ code and
generate some fragments of LaTeX. Adding in some calls to the dvips and ps2pdf
programs completed the process.

After a bit of work it became evident that the version of OWLAPI that I was
using had a problem with one of the functions that I wanted to use. The release
notes for the subsequent version indicated that this had been resolved, so I
downloaded the latest version and recompiled it using GCJ.


At this point things started to go wrong. The program would build OK, but when
run it would disappear into a loop that steadily used up all available memory.
I tried to run it under Valgrind to determine where the memory leak was, but it
promptly reported that I was attempting to execute an illegal instruction.
Trying it under GDB was no better; it reported a segment violation and showed
a stack trace that made no sense whatsoever. As far as I can tell the code
generated by GCJ was not being loaded correctly by the linker. After a week or
so of trying to get to the root cause I decided that perhaps an alternative
approach was warranted.

The only other solution I can think of for combining Java and C++ is to use CORBA.
The OWLAPI library would be made into a server process and the application would
be a client. This would give the application some additional freedom since we
could now distribute it across multiple processes or machines if necessary.
However, I wanted to use open source and it became apparent that there was no
viable open source CORBA product that had bindings for both C++ and Java. There
were plenty that supported Java and a few for C++, but nothing workable for both.
I was starting to look into passing data between CORBA implementations, which seemed
to be a possibility thanks to standards employed by these products. The idea
of having to support two CORBA implementations, though, was a bit of an issue.


During my CORBA research I came across the ICE product by ZeroC. This product is
open source, has bindings for a wide range of languages and platforms and seems
to be actively supported. It works much like CORBA but without a lot of the
complexity, which I think is nearly always a good thing. After a few experiments
to become familiar with building ICE applications I redesigned the interface to
use ICE generated code and successfully completed the proof of concept.

My work with Protege to develop the quality attribute ontology highlighted a
problem with the visualisation of the ontology. I decided that it would be good
practice to develop an application that would enable its user to graphically
navigate the ontology and to display all the relationships between the entities
of the ontology. I used the GraphViz dot program to generate a diagram based on
the data extracted from the OWLAPI using the ICE generated interface. The
output of dot was set to SVG and I used Qt's SVG and SceneGraph components to
create the visual representation. The result was a program that can quickly
navigate an ontology.

The first increment of the project was thus completed successfully, albeit with
a radically different architecture that was first envisaged. We now have a basis
for designing and developing the software.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Saturday 16 July 2011

SASSY - Project Establishment

The preliminary analysis did not turn up any insurmountable issues, so the
next step is to establish a project for the development. While I do intend for this
project to eventually be a collaborative development, I wanted to get the core
of the project written in a more private setting. Once I have something usable I
will transfer it to a public development area, such as Source Forge.

Fedora Linux

Since I am most comfortable in a Linux environment, and it has all the development
tools I could possibly want readily available, the project will be established
on my personal computer which runs Fedora Linux. I chose Fedora as it is based
on Red Hat which I often use for work, but tracks the latest developments. I
avoid the worst of the "bleeding edge" by remaining one release behind. This
means that all the issues will have been worked through when I upgrade.

Project Structure

The first step is to create the directory structure for the project. I created
a typical Subversion structure containing a trunk, tags and branches directories.
I will be using Subversion as my version control system. Once it goes public I
may consider using Git, but that is a decision I can make later. Within the trunk
I then created a bin, lib and include directories to install into, plus a docs
directory for documentation, an ontologies directory for data and a workspace (ws)
directory for the source code. The use of ws rather than src comes about since I
will be using Eclipse for the project's IDE, and it creates workspaces into which
the source projects are placed.


Documentation

I find it useful to document stuff (my memory isn't what it used to be), and for
this project there will be several documents, so the next step was to create a
document template for the project. The vision statement and the preliminary analysis
were then brought into the project. I will initially use Open Office, but expect to
move to Libre Office in line with Fedora.

There will be various diagrams for class diagrams and such. I use Dia as my diagramming
tool since it does a reasonable job of UML, and includes a variety of other symbol sets.
The aim of SASSY is to automate the creation of the diagrams, but until its up and
running I will need to do them by hand.


Tool Set

I like to document the various products that I use on a project. It makes it much
easier on the next project to be able to refer back to how it was done last time.
For each product I record how it was installed, any configuration that was done,
and any tips for using it.

As mentioned I will be using Eclipse for the IDE. Normally I would just run up a
few terminal sessions and use vi to do the editing. However, when working with
large, complex libraries things like auto-completion are very handy. I expect to
be doing C++ development as well as Java, so I included the CDT package from the
Eclipse repository. The CDT package also supports autotools which can simplify
development if we ever need to support a range of platforms.

For designing the user interface the Qt Designer is a suitable product, especially
since I will be using Qt for the user interface programs.

For defect tracking I am a fan of Mantis. I wanted to use PostgreSQL for the
underlying database, and after a bit of hacking I have this working satisfactorily.
For the very large projects that are the very reason for SASSY we will eventually
need to store the data in a database, as opposed to a simple XML file, so getting
PostgreSQL into the mix early on has some plusses.

Component Products

For the user interface programs I have chosen the Qt libraries. This package has
a complete user interface library in C++, is available for a variety of platforms,
and is open source. It also has an abstraction layer for the operating system which
may eventually be useful if we support multiple platforms. The only down-side I
see is that it has its own implementation of templates for containers etc rather
than use the STL. This can result in a lot of code moving data between containers.

The Protege product provides a complete front end for entering and editing an
ontology. It is under active development but is satisfactory for the initial
development. There are currently some issues with large databases and multiple
users for the OWL version 2 environment, but I am hopeful that these will be
resolved by the time we need them.

Program access to the ontology database is via a Java library called OWLAPI,
available from Source Forge. I am also looking at the owldb library which
aims to provide the database storage for large projects.

The mixture of C++ and Java presents a small problem since you cannot easily
call the Java libraries from a C++ program. My approach, initially, was to use
GCJ and compile the OWLAPI library into a form that can be linked into a C++
program. This eventually came unstuck, but that is a story for another time.

The documents will have diagrams so the GraphViz package gets a run for this
project. It allows you to input a graph in a simple format and does all the
layout for you, producing an output in a variety of formats.

The document formatting will be done with the LaTeX package. The output can
be converted to PDF using various command line tools.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Saturday 2 July 2011

SASSY- Analysis, Part 9

Interfaces


In this last blog on the preliminary analysis for the SASSY project we look at the interfaces between our software architecture system and the surrounding environment.

Input Interfaces


The inputs to the software architecture process are the vision statement, the preliminary analysis document, the data dictionary and the functional and quality requirements documents.

The software architecture process also contains a body of its own knowledge. Currently this is mostly held in the expertise of our software architects, but for this project we aim to capture as much as we can into a core software architecture ontology.

For a general project there may not be much control over the format of the inputs since they may come from a client who will simply provide the requirements etc. as a set of word processing documents. We can either accept these documents as the input, or transcribe them into the ontologies described in the previous blog. It may be that the act of transcribing them will uncover gaps which the preliminary analysis can attempt to resolve.

Output Interfaces


The outputs from the software architecture are a set of documents and diagrams that describe the system from a range of viewpoints.

Glossary
From our vision statement we intend to use knowledge engineering, specifically ontologies, to store the software architecture, and we also understand that we intend for this to be used when creating very large systems. One of the tasks in building a system, and an output of the preliminary analysis, is the glossary or data dictionary for the project's terminology. For a very large system it would seem logical to use an ontology to store this data dictionary.

Given that the aim of this project is to produce documentation from the contents of an ontology, it would seem reasonable to extend the project to the generation of the glossary ontology.

Requirements
It is often useful to know how all the parts of a software system are related. In particular it is often useful to know what functional or quality requirements drove various aspects of the design, code, testing, documentation, etc. If we were to relate all the components of a system together into an ontology then it might be possible to readily deduce such information and thus be in a better position to maintain the system.

Hence the requirements for the system should be drawn into the software architecture ontology, or perhaps exist as an ontology of their own which can then be referenced from the SASSY ontology.

Quality Attributes
Also from the vision statement we can expect our system to have a core Software Architecture ontology, and part of this will be a collection of quality attributes. These would be of interest when creating the Quality Requirements document, so it would appear to be a useful extension to the system to be able to print out such a list from the Software Architecture ontology.

Document Format
There are a variety of possible formats for the documents, ranging from plain text, to HTML, Word Processing and to PDF.

While plain text might be the easiest to generate, and it has advantages if you want to do further processing with it, it does not present very well to those that expect to see a high quality product.

HTML is fine for on-line viewing, but generally does not print well. If XHTML is used it can still be further processed if necessary.

The internal format of most word processing documents is quite complex, and sometimes not well documented. This makes generating the documents quite difficult. The other problem with word process documents is that they can be subsequently edited. There is, therefore, a danger that the output documents will be maintained, rather than the underlying ontology. This could lead to confusion as documents get out of step.

One option that produces high quality output, in PDF, is to generate LaTex. This is a well documented format that is easy enough to generate.

Diagram Format
The natural choice for diagrams is SVG. This is easy to generate, both manually and with various tools.

It is also easy enough to further process if necessary, since it is just XML.

While simple diagrams can be, and probably should be, embedded into the documents to which they refer, larger, more complex diagrams might be better left as separate documents.

If we allow separate documents for the diagrams it opens up some additional possibilities. We might introduce a third dimension and create a 3D model that can show more complex relationships than would be practical for a 2D diagram. Alternatively we might use animation to show how things change over time.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Friday 1 July 2011

SASSY – Analysis, Part 8

Ontologies


In their papers [BER06] and [HAP06] four different purposes are proposed for using ontologies:
  • Ontology–driven development (ODD): ontologies are used at development time to describe the domain.
  • Ontology–enabled development (OED): ontologies are used at development time to support developers with their activities.
  • Ontology–based architectures (OBA): ontologies are used at run time as part of the system architecture.
  • Ontology–enabled architectures (OEA): ontologies are used at run time to provide support to the users.

The SASSY project aims to demonstrate how ODD and OED can be used during the architecture phase of development. Of course this means that the SASSY project itself will also use OBA and OEA.

Data Dictionary
An ontology (ODD) can be used to describe the problem domain. [HAP06] For projects beyond a certain size a simple glossary of terms ceases to be of much value. Once the project has got to the size where it becomes difficult to remember all the names of things you need something more than the ability to look up by name. An ontology with its more structured and linked view can make finding things easier.

The ontology also allows you to capture the relationships between objects, and, using data properties, it allows you to begin the object modelling.

Requirements
The requirements for a very large system can become a huge document in its own right. It is also common for there to be relationships between the requirements. Thus the requirements are another candidate for an ontology (ODD). [HAP06]

The ability of the Web Ontology Language (OWL) to import one ontology into another means that a requirements ontology can be imported into other ontologies, such as the software architecture ontology and the traceability ontology.

There are quite a large number of possible Quality Requirements that might be considered when creating the requirements document for a system. An ontology (OED) of documented candidates can be referenced during the development of the system requirements.


Software Architecture
The Software Architecture discipline has a large body of knowledge that might be more useful as an ontology (OED). The SASSY project aims to demonstrate the utility of such a collection.

There should be a static ontology that encapsulates the discipline, and a second that captures the specifics of the project.

Since OWL allows ontologies to be imported into other ontologies it might be sensible to partition the SA discipline into several smaller ones.

Traceability
For many systems it is important to know how each component depends on the system requirements. There is rarely a one-to-one mapping from requirements to components, or lines of code, so some way of capturing these relationships seems to be called for. An ontology (OED) seems like a candidate, and the SASSY project should support tracing requirements through the architectural design phase.

Configuration Management
When a large system is being developed by multiple teams, working at differing rates, perhaps even on completely different increment cycles it can become “interesting” trying to keep track of which combinations of components are known to work together (or not).

An ontology, with its ability to handle a large variety of relationships, seems like a good fit to the configuration management problem.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
References

BER06: Julita Bermejo Alonso, Ontology-based Software Enginnering, 2006
HAP06: Hans-Jörg Happel, Stefan Seedorf, Applications of Ontologies in Software Engineering, 2006

Thursday 30 June 2011

SASSY – Analysis, Part 7

Architecture Analysis


Once a design has emerged it needs to be analysed to determine how well it will meet the requirements. The analysis is usually a risk based approach since a complete formal analysis would be too time consuming.

The usual approach is as follows:
  • Each quality scenario is examined in turn. For each one a rating of its importance is given – low, medium or high. The stakeholders will need to discuss and agree on these ratings.
  • Then each scenario is examined to see how it will perform under the proposed design. A risk level (low, medium or high) is assigned indicating how easy it is likely to be that the requirement can be met.
  • The important and high risk scenarios become candidates for alternative tactics or designs.

However, once we have the architecture in a machine usable form we have some additional possibilities. We can perform various measurements on the interconnections between the components to get metrics for the dependency relationships.



In his thesis on a Software Architecture Analysis Tool Johan Muskens suggested the following measurements:
  • Components that call a service or from which a service is called in context of a scenario that is part of a specific use-case. The main thought behind this metric is that related functionality spread over the design is bad for maintainability and reusability.
  • The number of use-cases that contain a scenario in which a service of a specific component is called or in which that component calls a service. The main thought behind this metric is that cohesion within a component should be high.
  • Tasks should be distributed over the design as equally as possible. When the number of called services of a component is high this can give an indication that the component is a possible bottleneck when considering scalability. It also indicates that dependency of other components on the specific component is high.
  • the number of service calls of a specific component for all scenarios. Main thought behind this metric is that dependencies are bad for reusability and maintainability.
  • the number of different services called by a specific component for all scenarios. Main thought behind this metric is that dependencies are bad for reusability and maintainability.
  • the number of provided services of a specific component. The main thought behind this metric is that a well balanced distribution of functionality over the design is good for extendibility and maintainability.
  • the number of components of which a service is called. The main thought behind this metric is that dependence on many different components is bad for reusability, extendibility and maintainability.
  • the number of components that call any service of a specific component. The main thought behind this metric is that a large number of components depending on a specific component is bad for extendibility and maintainability.
  • the average number of state transitions per service for a component. Main thought behind this metric is that complexity of components / services is bad for maintainability and extendibility.
  • the maximum number of subsets of services of a component such that the sets of use-cases using services of the subsets are disjoint. It gives an indication of the cohesion between the services provided by a component.
  • The last metric gives an indication of the complexity of a scenario. It measures how deep the service calls are nested for a scenario. If the depth of a scenario is to high this is bad for the understandability and therefore also bad for maintainability and adaptability.


The absolute values for these measurements is not the important criteria. However, values that are abnormal may indicate some problem with the design.

If we add attributes to the components then we can also measure things like performance and portability for the overall design. For example components could have an attribute that indicated what platforms it was suitable for. This would then feed into the execution architecture to control how the components would be assigned to platforms. A performance attribute for each component could be used to assign components to CPU cores to get the best cost vs performance balance.

It might be possible, eventually, to automate the analysis phase sufficiently to enable it to be used to automatically refine the architecture. Techniques such as genetic algorithms might be able to generate and test various alternative designs and perhaps come up with some new design patterns. For the really large systems that we are contemplating this might be the only way to do it.

This is the completion of the description of what a software architecture is. Next we will look at ontologies as these will form the basis for SASSY.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Wednesday 29 June 2011

SASSY – Analysis, Part 6

Views and Viewpoints


The proposed design is documented in a series of Views, each from the viewpoint of one or more stakeholders.

It is important to keep the number of viewpoints in each diagram or document to a minimum, otherwise there will be confusion over what the document is trying to express. This means that for a large system there can be a multitude of documents, which can become a hindrance to the understanding of the system in its own right.

In the paper [M&B05] describe six types of architectural views – behavioural and a structural views for each of the conceptual, logical, and execution architecture. They go on to suggest the following should form the minimum set:
  • Reference Specification. The full set of architecture drivers, views, and supplements such as the architecture decision matrix and issues list, provides your reference specification.
  • Management Overview. For management, you would want to create a high-level overview, including vision, business drivers, Architecture Diagram (Conceptual) and rationale linking business strategy to technical strategy.
  • Component Documents. For each component owner, you would ideally want to provide a system-level view (Logical Architecture Diagram), the Component Specification for the component and Interface Specifications for all of its provided interfaces, as well as the Collaboration Diagrams that feature the component in question.

For SASSY the knowledge base forms the reference specification. The management overview seems to be a collection containing the original project vision statement, the preliminary analysis, in addition to a view showing the conceptual architecture. The component documents outlined above would be a good start, but you will also want other views, such as a network view and a database view, that have a system wide perspective.

There are a lot of different views that can be created for a complex system. Various researchers have attempted to classify these views into view models, such as the 4+1 Architectural View. Despite these models the views for any particular system should be carefully selected according the specific requirements of the project.

The core ontology for SASSY will need to have a collection of views defined along with a relationship that allows the components of the design to be associated with one or more views. We might also include view models so that the user can quickly select a collection of views that will have good coverage of the design.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
References

M&B05: Ruth Malan and Dana Bredemeyer, Software Architecture: Central Concerns, Key Decisions, 2005

Tuesday 28 June 2011

SASSY – Analysis, Part 5

Design Patterns


Once the tactics for achieving the desired quality and functionality have been selected the next step is to choose the design patterns that can best implement those tactics. Note that we are not interested in design patterns that deal with algorithms and data structures (such as the observer pattern) but rather we are looking for structural design patterns such as a client-server design.

The SASSY Ontology will need to include a catalogue of architectural design patterns and provide a means to include them into the design for a specific system. High level patterns such as ETL, SOA, Publish/Subscribe, Client/Server, Message Exchange, Peer-to-Pear and Data Warehouse will need to be included. More structural patterns such as Layered Architecture, Pipe and Filter and Event Driven Architecture will also need to be included.

A quick review of the literature has not turned up a very large number of architectural patterns, so this ontology is likely to be easy to implement and manage.

Products


We will also be looking at various existing products that can be used to implement the selected design. For example a message based design might select IBM's Websphere-MQ message queuing product.

Selecting a COTS product may have some side effects. In their book [WAL02] repeatedly stress that the examination of a COTS product may influence the requirements for the project. When users see what a product is capable of, they may want their system to also have that capability. This is to be expected. They also describe cases where the software exhibited behaviour that was not desired because the functionality was not correctly disabled, for example.

The options available will present different flexibility choices. A commercial product will constrain the remainder of the system to its interfaces. An open source product, if used unchanged would be the same, but there is the possibility of making modifications to it. The most flexible alternative is to build your own, but that flexibility comes at the cost of doing the development, and the corresponding time delay. A possible option is to start with COTS, then migrate to OSS or in-house developed at a later release of the system, once the initial time-to-market pressure has eased.

The number of products available is extremely large. While building an ontology of available products would be extremely valuable it will have to be placed beyond the scope of this project for now.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Monday 27 June 2011

SASSY – Analysis, Part 4

Decomposition


One tactic that is common to any large project is to divide it into more manageable pieces. Malan and Bredemeyer describe how the complexity of a large project can be addressed by the architecture:
Intellectual Intractability
The complexity is inherent in the system being built, and may arise from broad scope or sheer size, novelty, dependencies, technologies employed, etc.

Software architecture should make the system more understandable and intellectually manageable—by providing abstractions that hide unnecessary detail, providing unifying and simplifying concepts, decomposing the system, etc.

Management Intractability
The complexity lies in the organization and processes employed in building the system, and may arise from the size of the project (number of people involved in all aspects of building the system), dependencies in the project, use of outsourcing, geographically distributed teams, etc.

Software architecture should make the development of the system easier to manage—by enhancing communication, providing better work partitioning with decreased and/or more manageable dependencies, etc.


My experience with very large projects leads me to the conclusion that the first partitions should be on political lines. This has the advantage that it also divides the stakeholders which can be a significant step towards getting a solution. All that has to happen is for the interfaces to be defined and each subproject can be worked upon independently.

This should be repeated recursively until tractable projects emerge.

A variation on the political division idea is to also include a “technical” partition in addition to the functional partitions. This is made responsible for the common aspects of the system. It can be an easy sell to the stakeholders as it reduces their individual costs, being a shared component. You can then move functions in or out of the technical sub-project as best suits the design. The stakeholders will then also gain an appreciation of the cost of having a special component, and may decide that the cheaper alternative is to modify the business process instead.

In their Attribute Driven Design technique Bass, Clements and Kazman describe the following steps for designing the architecture:
  1. Choose the module to decompose. The module to start with is usually the whole system. All required inputs for this module should be available (constraints, functional requirements, quality requirements).
  2. Refine the module according to these steps:
    1. Choose the architectural drivers from the set of concrete quality scenarios and functional requirements. This step determines what is important for this decomposition.
    2. Choose an architectural pattern that satisfies the architectural drivers. Create (or select) the patterns based on the tactics that can be used to achieve the drivers. Identify child modules required to implement the tactics.
    3. Instantiate modules and allocate functionality from the use cases and represent using multiple views.
    4. Define interfaces to the child modules. The decomposition provides modules and constraints on the types of module interactions. Document this information in the interface document for each module.
    5. Verify and refine use cases and quality scenarios and make them constraints for the child modules. This step verifies that nothing important was forgotten and prepares the child modules for further decomposition or implementation.
  3. Repeat the steps above for every module that needs further decomposition.
An ontology with its subclassing capability seems like a good fit for decomposing a system into its component modules. If SASSY fulfils its requirements the step 2c above will be significantly automated since the point of the project is to generate the various views of the system.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Saturday 25 June 2011

SASSY – Analysis, Part 3

Requirements


The requirements for a system come in three categories: Functional, Environmental, and Quality.

The functional requirements describe what the system is required to do.

The environmental requirements are usually restrictions that the system must conform to, such as the operating system that must be used, or that the software will be for medical use.

The quality requirements describe those other aspects of the system, such as performance, safety, usability and maintainability.

Tactics


The components of a system have a set of responsibilities. Each component has assigned to it a set of things that it is responsible for.

For the functional requirements these normally map directly to a component’s responsibilities. That is, a particular component will be responsible for a particular system function.

For the quality requirements however there is no single component that is directly responsible. No component could be responsible entirely for the performance of the system. A tactic is what maps these requirements to a set of responsibilities which can then be assigned to components. For example a scalability requirement might be met by using a client-server design – the tactic. We can then map the consequential responsibilities to components; in this case by putting a service in one component and a client in another, and perhaps a name lookup service in a third.

Thus the design process is one of selecting a set of tactics that give the best response to each of the quality requirements. Of course there will be competition since using one tactic might compromise the use of another – it is hard to have a system that has both good security and good usability, for example.

In their introduction to tactics Bass, Clements and Kazman define a tactic as a design decision that influences the control of a quality attribute response. They also define an architectural strategy as the collection of tactics, and an architectural pattern as something which packages one or more tactics.

The software architecture ontology that will form the foundations for SASSY should include a collection of well known tactics and their relationships to the quality attributes.

Alternative Requirements


While considering some potentially very large systems it became apparent that sometimes the requirements were not always single valued. For example, building a system to support an entire organisation might have an environmental requirement that the solution must use Microsoft products where possible. However we can easily imagine a similar project that had a requirement for open source software where possible. The conceptual architecture for these two alternatives is likely to by almost identical, with the differences appearing in the logical and execution architectures.

Similarly the same project – a system to support an entire organisation – might be required to support a small office, a one-man company, or a large government department. When you look at the functionality, a lot of the requirements are identical but the quality requirement of scale has various alternatives. Again the conceptual design is likely to be quite consistent across all scales, but the logical and execution architectures will diverge.

It would seem then that the design of SASSY should include the capability of creating a suite of alternative designs based on these varying requirements.

It is somewhat amazing that we have gone from systems that are gigantic in scope to suites of such systems !

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Friday 24 June 2011

SASSY – Analysis Part 2

Quality Attributes


A fundamental driver to modern software architecture development are the quality attributes that the system is required to have. Factors such as performance, security, safety, usability and maintainability are often much more important in the design process than the functional requirements.

It is so important to have these quality requirements that we should provide some support in SASSY for their acquisition.

The core ontology for SASSY will be the software architecture knowledge base. An important part of that ontology will be a collection of quality attributes. The system should allow its user to assign an importance to each attribute for the specific project and thus include the quality requirements in the project's ontology.

Quality Frameworks


Several researchers in this field have developed classifications of the quality attributes according to how they see the relationships between them. One such classification has been promoted to being an ISO standard.

FURPS
A model developed by Hewlett-Packard that partitions the quality attributes into Functionality, Usability, Reliability, Performance, and Supportability.
Boehm
A model that partitions the quality attributes into Utility, Portability, and Maintainability. Utility is further divided into Reliability, Usability, and Efficiency.
McCall
Another model that partitions the quality attributes in a manner similar to the Boehm model, dividing them into operations, transitions, and revisions.
Dromey
This model partitions the quality attributes into Correctness (Functionality and Reliability), Internal (Maintainability and Performance), Context (Portability and Reusability) and Descriptive.
ISO-9126
This model partitions the quality attributes into Functionality, Reliability, Maintainability, Usability, Portability and Efficiency.

We should allow the user to select whichever classification they need, or use what might be called the Ontological classification of all known terms.

Quality Attribute Scenarios


It is all very well to specify that the system must achieve some quality requirement, but it is of no real use if there is no way to determine if the requirement is being met. In their book, Software Architecture in Practice, Bass, Clements and Kazman describe a set of Quality Attribute Scenarios that can be used to test the quality of a system.

Each scenario consists of six parts:
  • The source of a stimulus which is some entity that generates a stimulating event.
  • The stimulus which is some event that must be considered when it arrives at the system.
  • The environment in which the stimulus is processed, such as a running instance of the system, or a system under some stress.
  • The artefact that is stimulated, which may be the entire system or some part of it.
  • The response that the system makes after the arrival of the stimulus; and
  • Some measurement that can determine how the system responded.

While some these are quite obvious, such as how long the system takes to respond to an incoming event, others are a bit more problematic. For example it is quite reasonable to have a quality requirement that states that the system must be easy to maintain. However, the system itself is unlikely to include facilities for self modification. This sort of requirement forces us to expand the scope of what we mean by “the system” to include not only a set of running executables, but also the infrastructure required to maintain it – the maintenance team becomes part of the system.

SASSY will need to include the ability to set up these scenarios for all the important quality requirements.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Wednesday 22 June 2011

SASSY – Analysis, Part 1

If we are going to build a system for doing software architecture we had better get a very good grip on what a software architecture actually is.

Scope


Garlan and Shaw describe software architecture as the design problems that go beyond the selection of algorithms and data structures:

“Structural issues include gross organization and global control
structure; protocols for communication, synchronization, and data
access; assignment of functionality to design elements; physical
distribution; composition of design elements; scaling and
performance; and selection among design alternatives.”

A common theme in the discussion of the nature of software architecture is that it covers those design issues that encompass more than one component module of the system.

Malan and Bredemeyer describe the central concerns of a software architect as being the setting of system wide priorities; system decomposition and composition; system wide properties, especially those that cut across multiple components; how well the system fits its context; and the overall integrity of the system.

Structure


Malan and Bredemeyer describe an architectural framework as having three main layers:
  • A meta-architecture with a focus on the high level decisions that will strongly influence the structure of the system, rule certain structural choices out, and guide selection decisions and tradeoffs among others.
  • An architecture with a focus on decomposition and allocation of responsibilities, interface design and assignment to processes and threads; and
  • A set of guidelines and policies which guide the engineers creating designs that maintain the integrity of the system.
The architecture layer is further divided into three sub-layers:
  • A conceptual architecture with a focus on identification of components and allocation of responsibilities to components;
  • A logical architecture with a focus on design of component interactions, connection mechanisms and protocols, interface design and specification, and providing contextual information for component users; and
  • An execution architecture with a focus on the assignment of the runtime component instances to processes, threads and address spaces; how they communicate and coordinate and how physical resources are allocated to them.

Process


At its core the software architecture process entails taking the requirements and preliminary analysis and developing a set of documents and diagrams describing the system to be constructed.

The functional requirements, and perhaps more importantly the quality requirements are first examined in order to develop a set of tactics that will best satisfy those requirements. The software architecture discipline has a large body of well known tactics that can be combined to produce the approach for the specific problem.

The tactics are then used select appropriate COTS products and to develop a set of design patterns.

The project is divided into sub-projects which can each be separately developed. This is important for large projects, since very few large projects ever complete successfully it is necessary to subdivide them into manageable chunks to a size where the success rate is more satisfactory.

The overall design is then subjected to an analysis to determine if it is a viable solution.

The interfaces between these components is then fully documented so that each sub-project can get under-way as soon as possible.

A set of scenarios are developed that will form the basis of the test cases for the system. These tests are designed to ensure that not only are the functional requirements met, but also the quality requirements.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Sunday 19 June 2011

The SASSY Project - Introduction

The Super Sized Software page introduced the idea of the very large project. At
the end I lamented the lack of any decent support for building really large
systems. The Software Architecture Support System (or SASSY) is a project I have
undertaken to try and address this problem.

The basic idea is to build a knowledge database containing all the information
concerned with the architecture of the system. By having a single repository
we avoid the issues of having things get out of synch. We can then generate
all the architectural documentation from that repository.

My plan is to do the initial development as a personal project, and if it starts
to look promising, migrate it to Source Forge and open it up for others to assist.
Such projects will only take off if there is something solid to start
with - hence the initial private project.

While SASSY is not likely to become a hugely complex project, I though that it
might be interesting to use itself as its first project. This way I only have
to design the architecture for one system, not two.

The Vision Statement

The goal is to produce a software system that assists with the task of creating
an architecture for a software system.

The current process involves writing text documents, typically using a word
processor, and trying to embed into them a set of diagrams that describe the
proposed design at a high level. The results are generally not very satisfactory
for a variety of reasons.

Creating diagrams for inclusion into word processing documents is not easy.
Some word processors are quite poor at handling diagrams. There are serious
limits to the complexity that can be described in such a diagram. For a complex
system the diagram will either be too cluttered to be readable or such a high
level view that it is essentially meaningless.

Creating diagrams is often manually intensive. Even with diagramming editors
that have the appropriate symbols and an understanding of what the symbols
represent it is still necessary to place the symbols and label them. This
takes a considerable amount of tedious effort. The result is that diagrams can
quickly become out of date as the design evolves but there is not time to
revisit the diagrams. There is also a tendency to combine several aspects of
the design into the one diagram. This can make the diagrams confusing and
ambiguous.

The use of word processing documents to describe the system also has its
problems. When writing a document it is usual to target a specific audience
- perhaps the developers, perhaps the stakeholders, for example. It is very
difficult to write a single document for the use of a variety of audiences.
It will have too much detail that is not relevant for most of its readers,
and conversely each reader will have difficulty finding the information that
they need.

The rather obvious answer is to create numerous documents and diagrams each
tailored to a specific aspect of the design. However this brings with it
another problem, namely, how to keep a large collection of objects consistent
while the design goes through its inevitable evolution?

The current process for developing a software architecture does not scale very
well. For very large projects it becomes necessary to use a significant number
of 3rd party products (unless you have an extraordinarily large budget). This
range of products can easily exceed the knowledge of any single architect.
Moving to a team of architects presents its own problems since the
project will no longer have a single visionary to guide it.

The objective of this project is solve these problems. The approach is to
capture the design, the software architecture, in an ontology or knowledge
database. Being in a single repository it can be kept consistent, and in fact
the tools available for checking ontologies can be used to identify any
inconsistencies. We will then develop a set of tools that can generate the
documentation and diagrams for each aspect or view that is required. A single
repository, with multi-user access, can allow multiple architects to
collaborate on the design process by enabling each one to easily see the
information that is relevant to the part of the project that they are working on.

Software will then extract the data from the knowledge base and feed them
into programs that will generate the text and diagrams. A user interface
component will coordinate the process. The output format should be PDF so
that there is less temptation to edit the output documents rather than the
source knowledge base.

Next time we will look at the preliminary analysis for the SASSY project.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Thursday 16 June 2011

Development Process

We have looked at the model and the methodology. Now we bring it all
together into a development process.

The process is what controls the development. We need to control the quality
of the system, the changes that can be made to the system, and the progress
in developing the system. The fourth pillar for managing a project is
knowledge distribution.

Change Control

The fundamental tool for managing change is the version control system. I am
amazed at how often I find projects that have not even this.

However, change control goes beyond what version control systems can provide.
You must be able to constrain the development to what is necessary to satisfy
the requirements. How you do this will depend on the project - it could be
nothing more than some guidelines in a document - or it might be a system that
prevents access to the code base without explicit authorisation, teamed with
a gate keeper that only allows changes to be merged in once they have been
thoroughly tested and reviewed.

A comprehensive test suite can be of great benefit in managing changes. One of
the impediments to applying a change is not knowing if it will break some
existing component. If you can run the test suite after applying the change
you can tell immediately if it has introduced a defect. The test suite thus
gives you the freedom to attempt to introduce more complex changes.


As well as changes to the code base, you will also need to manage changes to
the requirements. Once the users see the product they will start to
request changes. This may be because they can see that some of the COTS products
have more capability than they originally expected, or because the product allows
for new capabilities for the business.

The incremental development model allows us to manage the changes to requirements
in a controlled manner. At the start of each increment we should schedule a
short analysis task to consider how any new requirements might influence the
design. These requirements can then be scheduled into future increments, allowing
the product to evolve to meet the business needs.

In order to keep things under control you will need to keep a register of
change requests where you track how each one is progressing through the
development cycle. I find that an increment plan which describes what is going
to be done in future development cycles (and any dependencies) is a useful
device for explaining the long term development strategy.

Quality Control

The quality of a system has many aspects. The most important is functionality -
the system does need to do what it was required to do, but there are many, many
others. In the literature I have found over 130 terms used to describe some form
of quality attribute.

Quality Measurement
The first step to controlling something is to be able to measure it. There are
a few ways to measure the quality of a software system:

Code reviews can be a source of data for measuring the quality of the system.
A simple count of the noted defects (perhaps grouped by severity) will give a
guide to how well things are going.

Test harnesses are another source of quality data. The unit tests should provide
a report detailing the number of tests run, and the number of failures found.
Of course these are mostly aimed at the functionality of the system.

In order to test the non-functional quality requirements there needs to be a
set of tests designed to evaluate how well they are satisfied. For some
requirements this can be as simple as measuring the resource footprint, but
others will require more sophisticated tests, and others are so subjective as
to be close to untestable.


Actions
The spiral development model enables us to get the quality of the system under
our control. By deliberately starting with a lower quality product we can still
deliver much of the required functionality early in the process. We can then
make decisions about the best way of improving the quality of the product
and apply them, one by one, until the desired quality performance is met.

Progress Control

The aim of progress control is to deliver a system that satisfies the requirements
within the budget allocated to the project.

The first step is to determine what the budget actually is, and that involves
estimating the size of the project, based on little more than the initial
analysis and perhaps a feasibility study. Obviously, as the development unfolds
it gets easier to develop an accurate estimate, but this is often long after
any funding arrangements have been made.

Measuring the progress is the usual project management task of plotting the tasks
in a project management tool (such as MS Project) and keeping track of how much of
each one has been completed. Finer measurements, such as counting lines of code
can be used, but might be compromised if they are susceptible to tampering.

The iterative aspects of the modern development models can be an issue with
these project management tools. You need to add extra tasks for supporting
the subsequent tasks - for example there will need to be two implementation
tasks, one to create the code, and a second to fix the bugs found by the
test team.

Controlling progress is primarily achieved by assigning a suitable number of
developers to the project. Additional control can be had by using the incremental
model to defer some functionality, or the spiral model to defer some of the
quality, so that something useful gets delivered as early as possible.

Knowledge Management

This is an addendum to the original article.
On a recent project it occurred to me that there was a fourth element to the
development process, namely the distribution of knowledge about the system.
A quick way to ruin a project is to make one or more of the team members
indispensable because only they know some important aspects of how it all works.

In the examples that I have seen over the years the issue is not the fine details
of the algorithms that causes the problems, but rather the overall flow of data through
the processing that causes the most difficulty for new members of a team. Once they
have that big picture they can zero in on almost any issue. Conversely, without
that overview they are left utterly confused and reliant on the experienced team
members to point them at the likely cause of a bug. My preference is for a set of
diagrams showing the static relationships, a set showing the flow of data (including
processes, files and database tables) and a set of collaboration diagrams for most
use cases (preferably generated from the running code).

I once heard about a company (Japanese if I recall) that had a policy of firing
anyone who had become indispensable. This is perhaps a little to extreme, but not
by much, because if that person were to leave then your project might be in
difficulty.

Some mechanisms for knowledge distribution include collaborative working, code and
design reviews and regular team meetings to discuss deep technical issues. The
documentation for the system needs to be kept current and useful.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Tuesday 7 June 2011

Development Tasks, Part 4

This is the fourth part of a series describing the development tasks for a software
project. See Software Development Process and Development Methodology for the
context of this topic.

Implementation

Fill in the details of each method, and add test cases to the test harness to
exercise any that are non-trivial.

The coding should be guided by a set of coding standards. You should include
error handling from the first cut of the code so you can tell if its working
correctly. My usual approach is to start with a simple error message with file
name and line number to the console on the first cut and then add more
sophisticated error handling in subsequent rounds of development.

The code should be reviewed by other team members. This provides a mechanism to
spread the knowledge of how the system works across a broader cross section of
the team.


Documentation

Typical documentation includes on-line help (including tool-tips), user
manuals, and installation guides. You may also need to provide administration
guides if the system is complex.

The design documentation and programmer's guides should also be included in
the document set if the system is to be able to be extended by others.

The project documentation should be kept for reference by the maintenance team.


Use Case Test

We need to be able to demonstrate that the classes have been built correctly.


Interface and Application Integration

The aim is join the separately developed components into a single unified
system.

Combine the application and user interface classes.

Create shell scripts to mediate between executables and set their environments
and parameters. Retest the scenarios using the UI as a driver instead of
the test cases. Use the test plan as a guide to walk through the user transactions
that establish the test pre-conditions, then test the scenarios.



Generalization

The aim is to improve the design using a bit of hindsight.

Examine the class design in the light of implementation to find improved
structures. Review future increments to find potentially reusable classes
and separate out the reusable parts into new abstract classes. Look for
standard design patterns.

It is possible to spend too much time in this phase, finessing the code
without making significant improvements. It is possible to over do the
generalization, making the code harder to understand.


System Integration Testing

Many systems need to interface to other systems. These interfaces need to be
tested. This testing requires a different approach as it usually involves
other organisations.

Liase with the the system administrators of the other systems to organise the
test. Develop the procedures necessary for the systems to interconnect. Put the
remote systems into test mode and pass test data across the connections. Use
the test harness logging to verify that the systems communicate correctly.



Packaging

Once construction has finished, the system has to be packaged so that it can be
easily installed on the client’s machines.

The build script will include a mode that builds the delivery package. Once built
and tested, the files are copied onto the distribution media. Include a script
that will install the package onto the client’s system, possibly replacing the
previous version, and upgrading the client’s data files as necessary. The data
upgrade should be non-destructive so that the client can back out the upgrade
if they so wish.

Acceptance Testing

The client needs to assure themselves that they are getting what they paid
for.

You will need to support their testing by providing an environment that
allows the testing to be performed and the results to be gathered into
a useful format.

You will also need to provide some guidance on what tests to perform. While
the client should design the tests based on their requirements, it is the
development team that really understands what the product can do.


Post Implementation Review

The aim is to identify anything that could have been done better.
A combination of one-on-one interviews and team meetings should be used
to illicit ideas for improvement of the development process and the
product. The use of blogs and wikis by the team members should also be
encouraged as a means of proposing improvements to the process.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Friday 27 May 2011

Development Tasks, Part 3

This is the third part of a series describing the development tasks for a software
project. See Software Development Process and Development Methodology for the
context of this topic.

In the previous part we looked at the initial design phase. In this part we will
cover the detailed design of the proposed system.


Test Case Design and Construction

In this step we develop the test harness. This is done prior to code development
so that coding has something to test against.

Write the tests with input values based on the use case parameters in the
precondition set up. Evaluate the return code for completeness and correctness,
and log any discrepancies.


Use Case Design

Here we document the flow of information in the system. With an OO design it
can be difficult to understand the interactions between objects, so we document
that here.

Most texts will suggest that sequence diagrams are the correct tool for this task.
However its been my experience that these diagrams are tedious and messy to
construct, and very quickly become difficult to follow in all but the simplest
scenarios. I prefer to use collaboration diagrams as they can more easily show
the flow of control for complex systems. It is also possible to convert trace
data from a running system into collaboration diagrams, thus documenting the
real situation.

System Test Support Design

Just as modern hardware has “Power On Self Test”, so should a software system.
If we build support for system testing into the applications we can speed the
testing phase, and thus get the project completed sooner.


Persistent Storage Design

We need to define the format, and rules, that apply to the storage of the
application’s data. This usually involves experts in the storage component,
and can to some extent be started prior to the application specific work. It
will usually involve creating some additional classes to interface the
application specific classes to the storage mechanisms.


Class Design

Based on the method specifications and use case design, document each
attribute’s visibility, type, and initial value and for each method in
the class document its signature, visibility, and type.

Review the design against established design patterns to ensure that the
design is complete.

You may be required to do this step in a design tool, but my preference, when
developing C++ code is to do this step by creating the header files for the
classes and including stub versions of the implementation with comments
describing the intended design.


Code Generators

Many large systems will have a fair amount of code that can be generated from
significantly simpler descriptions of data structures. You should review your
design at this point to determine if there are any candidates for code
generation (before some poor programmer tries to write them by hand).

In the next part we will look at the implementation tasks.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Wednesday 18 May 2011

Development Tasks, Part 2

This is the second part of a series describing the development tasks for a software project. See Software Development Process and Development Methodology for the context of this topic.

In the previous part we looked at the analysis phase. In this part we will
cover the initial design of the proposed system.

Project Tools

This task is one that is on-going for the life of the project. It is
responsible for setting up and maintaining the various tools that the project
will use.

Initially this might be just a word processor, but it will expand to include
version control products, project planning programs, development environments,
and so on.

At the very least it should include a list of what tools are necessary to build
the system.

Architecture

This task is concerned with the design problems that go beyond the selection of
algorithms and data structures, concentrating on the overall structure of the system.

Structural issues include gross organization and global control structure;
protocols for communication, synchronization, and data access; assignment of
functionality to design elements; physical distribution; composition of design
elements; scaling and performance; and selection among design alternatives.

The output of this task includes multiple views (eg concept model, network model
database distribution, etc), a list of the products that will form part of the
delivered system, and the specification for the interfaces between major internal
components.

Interface Stubs

For each interface create facade classes for each module. Add stub code that
allows each interface to be called and return default values. Define the abstract
interface classes and stub interface classes for any callback style interfaces.

Create test harnesses that call these interfaces. These will evolve into test
harnesses for the modules. The aim is to be able to develop each module in
isolation from the other modules. (See Chaotic Programming.)

This task has the useful side effect of getting the programmers involved in
some actual development very early in the process.


Component Exploration

Third party products rarely behave exactly as expected, or they may be new to
the developers. They need to be well understood if they are to be used successfully.

Build test programs to demonstrate how the components work together. Document
the criteria required to get them to inter-operate as required for the project.

Note that there is some danger that the client will modify their requirements
when they see what the products are capable of.

Migration Planning

Most systems will start life with a body of data that was captured by its
predecessors. That data needs to be converted and loaded into the new system.
This task describes how that is to be achieved. We do this early so that the
ability to load data is designed in from the beginning.

Determine which data will be useful, and organise how it will be extracted
from the existing system and loaded into the new one. Determine how the data
will be cleaned up to get rid of incorrect values.

Test Planning

For every outcome of each use case (for the current increment), describe the test
cases, this includes the number of tests, how the pre-condition state will be
achieved, and how the post-condition state will be validated. Break this into
sections for acceptance testing, system testing, integration testing and unit testing.


Application Specification

The aim is to ensure that everything the programmer needs to know is properly
defined.

For each use case describe how each system attribute is changed.

The deliverables include use case descriptions, class diagrams, details of any
complex algorithms, and an updated data dictionary.

User Interface

Design the user interfaces for the system based on the use cases. This can be
done with a user interface design program which can then generate the classes
necessary to run the interface.

The resulting UI can then be used to confirm the use cases by demonstrating the
system to the users. Obviously you will inform them that this is just the UI and
that there is nothing actually working yet.

In the next part we look at the remainder of the design tasks.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Friday 13 May 2011

Development Tasks, Part 1

See Software Development Process and Development Methodology for the context
of this topic.

Vision Statement

A vision statement sets the goals for the project. It puts forward an idea
for others to consider. It will usually outline the problems that need to be
addressed and suggest some sort of solution.

The vision statement remains an important document for the life of the project.
It should be the first document that is read when wanting to understand what a
project is all about.

A vision statement can also help to keep a project constrained to its original
goals and help prevent scope creep.


Preliminary Analysis

This task elaborates and clarifies the client’s statement of need. It allows the
client to tell if the analyst has really understood the problem.

Discuss with the domain experts and do research into similar problems.
Investigate the implications of the requirements.

From the article "Making a success of preliminary analysis using UML"
“It is necessary to define the application domains on which a system is to be put in place, and the processes that the system must support. Terminology, definitions and domain boundaries are clarified, in order to explain the problem in a clear context. In this domain, functioning modes must be explained, in the form of business procedures, but also in the form of rules and business constraints."

One of the outputs of the preliminary analysis task is the first draft of the
project data dictionary or glossary.


Feasibility Study

The primary purpose of a feasibility study is to demonstrate that there is at
least one viable solution to the problem. For a solution to be viable it will
need to be realizable with the resources available and technically possible to
implement.

A feasibility study should concentrate on the technically novel components
of the system. There is no point in re-examining things which are readily
available such as web servers or databases.

It is not necessary for the study to produce the best solution, just one
which satisfies the minimum requirements, or which demonstrates that with
more development effort a satisfactory solution should be possible.


Modelling

This task applies when there is some existing system that is being replaced.
The existing system might be automated, or entirely manual paper based, but
either way it is important to document what it does before we try to reproduce
it.

From the article "Making a success of preliminary analysis using UML"
"An analysis of what already exists must be carried out, by representing it as a system whose structure, roles, responsibilities and internal and external information exchanges are shown. All preliminary information must be collected, in the form of documents, models, forms or any other representation. The nature of the products developed by the processes is explained.”

Requirements Gathering

This task involves creating a formal list of things that the proposed system
must accomplish. The list should have a well defined numbering system so that
requirements can be unambiguously referred to for the remainder of the project,
and beyond into the maintenance phase.

The functional requirements list what the system is supposed to do. These are
usually the things that most interest the users of the system.

The environmental requirements describe the environment in which the system
must operate. For example the system might have to operate using Windows
based computers, or it might have to operate in an aeroplane.

The quality (or non-functional) requirements will drive the architecture of the
system. Obtain the limits on the performance (speed and size), security, safety,
and resource usage (disk, memory, band-width). Determine the availability
requirements, how modifiable the system must be, the ease with which it can be built
and tested. Consider how soon the product must be delivered. Usability is often
an important requirement. This needs to be considered for the various users of
the system, from the occasional user to the “power” user. Describe what
is required to administer the system.

Deliverables

At this stage of the project you should have use case descriptions describing
how users will interact with the system, a list of the main actors and objects,
detailed interface formats for external systems (and memorandums of understanding
with the owners of those systems) and an initial idea of the increment plan.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Tuesday 10 May 2011

Development Methodology

The development phases outlined in "The Software Development Process" are
just the broad categories of tasks that need to be undertaken. The methodology
outlines all the potential tasks that a software project might need. It is
important, however, for the project manager to tailor these tasks according
to the needs of the particular project.

Analysis Phase

This phase attempts to define what it is that is required. It should avoid any
attempt to constrain the design; we want all options open to the designers so
they can come up with the best solution.

The analysis phase tasks include preparing a vision statement, preliminary
analysis, feasibility studies, modelling of existing systems, and requirements
gathering. For most real world projects there will also be some sort of approval
process to get the funding for the development.

Design Phase

The design phase starts with the software architecture and steadily refines the
design until it is ready to be handed to the programmers. The level of detail
required is highly dependent on the nature of the project. For a small project
in a well defined environment you could do the whole thing around a white board
in a few hours. At the other extreme it could take a large team many months and
produce a huge amount of documentation.

The design tasks includes developing the software architecture, planning the
migration from existing systems, developing the interfaces between the components
of the system (and to external systems), exploring the capabilities and limitations
of the proposed COTS products, defining the test strategy, creating a data dictionary,
creating use case and class diagrams, designing the user interfaces, designing support
for testing, designing the persistent storage, and designing any code generation
utilities that are required.

In parallel with the design tasks, it will also be necessary to set up the
development and testing environments, procure all the support tools required,
and recruit the team members into the project.

Implementation Phase

The programmers can often start with the interfaces to the components. These
should be well defined quite early in the design process. Stub and test versions of
each interface can be developed so that each component can be developed in
isolation by relying on the interface tests.

Similarly stub versions of the user interfaces can be developed and presented
to the client as a prototype of the application. This will confirm that the
requirements are correct and will set up the client's expectations for the
project.

The implementation phase includes the coding of the application programs and
libraries, the unit testing, the development of the documentation and the
development of the deployment guide. Testing of each use case should be done
as part of the implementation, preferably using some automated capability.
Quality control processes such as code reviews must be part of the schedule.

A generalisation task should be scheduled. This allows the designers and programmers
to revisit the design and re-factor some of the code. This will make the next
increment and later maintenance much easier.

Test Phase

The test phase is responsible for testing the assembled components (integration
testing) and testing the system in its enterprise context (system testing).

The test phase will also include the client's acceptance testing, so you will
need to support that.

Finally each round of development should finish off with a review so that
the development process itself can adapt to the team's strengths and weaknesses.

-- the next few blogs will expand the description of these tasks.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Saturday 7 May 2011

Software Development Process

This is the first of a set of blogs on the topic of developing software.
It relates to software architecture by showing the context; by showing how architecture
relates to the overall process.

I have always had an interest in the development process, but this was enhanced when
I got a copy of the book, "The Object Oriented Design Process” by Tom Rowlett.
The problem was that the methodology described left out many important steps, and
there was nothing about the actual development process - there was nothing on progress
control, change control or quality control. It occurred to me that I could
write a much better book, but unfortunately I am not much of a writer and there
has never been enough time. So these blogs will have to do for now.

There are three components to the development process: the model, the
methodology, and the management.

The first is the development model. This describes the overall structure of the
project and how it evolves over time. The models are "waterfall", "iterative",
"test driven", "incremental" and "spiral". Each one attempts to solve problems
with its predecessor, but still each can be used for certain categories of projects.

Waterfall

The waterfall model was the first formalisation of the development process.
The development of a system was divided into four phases: analysis, design,
implementation and testing. The project would be scheduled so that each phase
was completed before the next was begun. This simple model was well suited to
the usual project scheduling tools and has been the basis for managing projects
for many many years.

Of course there are some serious problems. If testing shows up a bug, you need
to send it back to the implementation phase to get it fixed. Similar problems
can occur in the other phases. Generally you only use the waterfall model for
very small projects in a well known environment.

Iterative

The iterative model formalises the feedback from one phase to the previous.
It allows the designers to begin work as soon as the analysts have most of
the requirements defined and it allows the designers to seek clarification
from the analysts. Similarly the programmers can start on some of the coding
earlier, and can seek clarification of the design. Testing and bug fixing can
be managed sensibly.

The main problem is that all the testing still happens at the end where the
pressure to complete is at its maximum.

Test Driven

The test driven model starts the testing process as soon as the requirements
have been defined. While the designers are developing the design for the system,
the testers can be designing their tests. The testing can begin as soon as some
components of the system have been developed.

This model works well for small developments, but for large projects it can
take too long to deliver anything, during which time the requirements can start
to change.

Incremental

The incremental model breaks the functionality of the system into separately
deliverable components, or increments. This enables us to get something
delivered quickly. It also allows the design to be adjusted if the requirements
change - each increment includes a small analysis and design step to keep the
project aligned with the business.

Note that not all increments get delivered to the customer as a release. An
increment should be a small, well defined body of work concentrating on a
single aspect and may only take a few weeks to develop. If the customer has
a lengthy acceptance testing procedure it might be overwhelmed by releases
that happen monthly, so it might be best to only do a release occasionaly.

The problem with large projects is that the first increment can take too long
to deliver since it has to create most of the infrastructure to support even the
smallest amount of functionality.

Spiral

The spiral model attempts to get early increments delivered more quickly by
using less or lower quality infrastructure. The project thus advances in two
dimensions at once - quality and functionality.

The main danger is that the initial low quality increments might give the
project a bad reputation, so it might be better to keep the first few as
demonstration only versions rather than as actual releases.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.