Showing posts with label software modeling. Show all posts
Showing posts with label software modeling. Show all posts

Monday, September 8, 2008

Modeling Languages

Modeling languages, like any language, have Syntax & Semantics . The Syntax defines the structure any instance model in it can take. each language will have an abstract syntax, and a number of concrete syntax it could be represented with.

Syntax:

concrete syntax can be visual or textual, depending on how we would like to describe the language. A modeling language can have both a textual and a visual syntax. ( think of to a very well defined toString method ) .
Visual Languages syntax can be divided into two streams:
  1. Connection based or Topological: where position and size of different language elements doesn't matter ( irrelevant ). the more specific next level in this branch is Graph based visual languages ( state charts ) , and the next is Plex languages ( DEVS or CBD) where the Arch attachment area have significance ( via ports for example )
  2. Geometric: where position of elements in the model instances does matter. a subset of this brach would the box based languages ( where no overlap is allowed ) (Snieder graphs). the next subset is iconic languages where overlap IS allowed, and the most specifc in this branch are string ( textual ) languages like programming languages for example.
Another thing should be mentioned is that all concrete syntax of a language are translated into the abstract tree syntax. which the essence of a model instance, and will be used in mapping to the semantics domain.
Note: the process of transforming a concrete syntax into the abstract is called Parsing. and the inverse is called pretty printing.

Semantics:
Each language has semantics which is defined by the semantics domain . for example if we take a sentence "2+3" for example, will map into "5" in the semantics domain.
The mapping function M[[ ]], can be in two forms ( they are both identical ):
  1. Denotational : like a translator describes "What"
  2. Operational: describes a procedure of "How" to compute . like a program.
The mapping function has to be unique ( meaning for each abstract syntax it will produce a mapping, and total, meaning that it can give a mapping for any valid input. note also that non-determinism here is ok.

Tuesday, July 22, 2008

Model Based Testing Vs Test modeling

Model Based Testing
Is just another testing concept. it's mainly built around the idea of using the models which describe a system to produce test cases to test the system. in UML we can look at a system's statecharts diagram to generate test cases that will guarantee state coverage for example. or even other coverage criteria. another example is use case based testing, which uses the use case model to generate high level user acceptance test cases.

Test Modeling
Test modeling describes an approach to model the overall testing activity of a system. specifically the testing system could be considered a seperate system of the testable system. and then it can be modeled through structural, behaviour and implementaion diagrams. in a nutshell test modeling is all about descibing testing concepts of a system as models that go hand in hand with the system under test models.

Tuesday, July 1, 2008

Model based design

Modeling:
Modeling is mainly about abstraction, and describing concepts from a different level. like in UML for example, we use boxes to represent classes, arrows to represent associations and relationships.
so when we build a complex system, before we would right the source code for it, we start sketching out different components of the system, and how they believed to interact and so on. then we use these boxes as a reference that we use while writing the source code. in fact these models will always help us to look at the big picture from a different abstraction layer.
this activity is called modeling. in software engineering modeling is mainly based on UML ( unified modeling language) but not restricted to it. in general we can call the language that defines the different models or components that we can use a formalism. UML class diagram, for example, is considered a formalism that lets you model classes and their associations and inheritance or even compositions. UML statecharts is another formalism that allows for modeling the state flow and interactions of a system. of course if we look at other systems we are not limited to UML formalisms, for example Petri nets, or DEVS amongst others are also powerful formalism with different purposes.

Meta modeling:

A formalism like the UML class diagram contains many elements. for example a class is an element that has a type class, has a property called name, and can have many attributes. it can also have many methods each with a qualifier ( public , private or protected) . and so on.
but where is all these things described and specified ? they are in something called the UML class diagram meta model. in general a meta model describes the grammar of a language, or a formalism. in the meta model also you can define the graphical representation of the elements of the formalism . for example you can choose to represent the class by a box with a header that includes its name. and so on.


Domain specific modeling:
Domain specific modeling is just normal modeling. the main thing that is involved here is that the modeling environment ( the formalism ) that will allow the user to build models is built specifically for the desired domain. to make this simpler here is an example . let's say i am a modeler and i wanna build a domain specific modeling language for building traffic systems ( arguably, i am doing that so that i give later to traffic system experts so that they can use it to build a traffic system model for the new city and analyze it). Then I can define this traffic modeling system by specifying the different elements it can have and the different links it can have between them. its really like designing your own UML language. so for example for traffic networks i can talk about defining a domain specific language that has road segments, traffic lights and car generators . i can then describe some constraints like for example a road segment can only be connected to a maximum of two other road segments. or a constraint that i can only connect a car generator to one road segment at any time. by doing this i take away some of the complexity that whoever is designing a traffic system doesnt care about. in this case the user will only worry about the problem domain ( building a traffic system) and not worry about how this system will map back to running code.
However, someone will need to worry about this mapping into a running program as the upcoming post on model transformation will describe.