Archive for April, 2007

Model driven architecture (MDA) with Enterprise Architect

Monday, April 30th, 2007

Hello!

There is a nice white paper named EA4MDA_Features__WP.pdf on the Cephas website (sorry, they don’t use search engine friendly URLs – you must look in download/white papers/model driven architecture) about MDA with Enterprise Architect.

The paper is nicely written, concise and concret, which is not often the case with this subject. For example there is a list of criteria for creating a complete and precise model that is a better source for model transformation. The list contains recommendations like (excerpt)

  • Consistently set navigability for associations
  • Define multiplicity for both ends of associations
  • Define unique names for attributes and both roles in associations

All this helps to create more and better code.

The paper then states important capabilities of MDA enabled tools and gives an assessment of Enterprise Architects implementation.

Sparx Systems also has a similar paper on their website which I find a bit more shallow than the Cephas paper.

Best regards,
Andreas

Technorati Tags: , , ,

Efficiently testing with NUnit and log4net

Monday, April 16th, 2007

Hello!

I have used Nunit for testing .NET based software (libraries) for quite some time now but I have not been entirely happy due to three reasons:

  • The only way to execute the tests was through nunit-gui or nunit-console. Both of these programs read the passed assembly via reflection and call the tests on the contained classes and methods. The problem with this approach is that there is no natural place to perform a single initialization and shutdown procedure that is contained in the component under test.
  • In particular it was not easily possible to configure log4net.
  • Finally, nunit-console and nunit-gui load the component under test in a separate AppDomain and this makes interactive debugging quite slow.

Recently, I have been so annoyed by these restrictions that I took some time to find a solution. On the NUnit Homepage I read that the new version 2.4 now allows more control over the creation of a dedicated AppDomain for the component under test (see the release notes).:

The new /domain option controls of the creation of AppDomains for running tests. The following values are recognized:

None
No domain is created – the tests are run in the primary domain. This normally requires copying the NUnit assemblies into the same directory as your tests.
Single
A test domain is created – this is how NUnit worked prior to version 2.4
Multiple
A separate test domain is created for each assembly

This sounded as if it could solve the problem of slow debugging when running under NUnit.
Still, the problem remained that there is no natural single point of initialization. What I wanted was:

  • Create a .NET console application
  • Add classes and methods and tag them as usual as test classes/methods with attributes.
  • Add one time initialization and cleanup code in the applications Main() method.
  • Run the executable in the Visual Studio debugger with breakpoints and automatically execute the tests as defined by the attributes.

I found a posting on Charlie Pooles NUnit blog that gave me the missing hint. All I had to do was to call the desired method in the relevant NUnit assembly:
class TestClass
{
[STAThread]
static void Main(string[] args)
{
log4net.Config.XmlConfigurator.Configure();
NUnit.ConsoleRunner.ConsoleUi.Main(args);
Console.ReadLine();
}
}

And that’s it!

Here is a summary:

  • Use NUnit 2.4 or newer
  • Create a C# or VB.NET Console application
  • Add required references including log4net and NUnit
  • In your applications Main method add all required initialization (and shutdown if necessary) code.
  • Set the compiled executable as target for debugging.
  • Add (at least) these arguments in the ‘Properties’ dialog of the project: /domain=none <your executable>
  • Add a suitable (standard log4net) App.Config file to your project

Console output of NUnit run

Technorati Tags: , , ,

My experience with Eclipse and Octopus…

Tuesday, April 10th, 2007

was a sad one.

There is the Octopus tool for checking OCL expressions and since it comes from the creators of OCL – Anneke Kleppe and Jos Warmer – I thought it would be interesting to compare it against Oclarity. I have already tried this about 2 years ago and miserably failed. In the meantime Eclipse has matured and a new version of Octopus was released. So I decided to try it again.

Installing the newest Version of Eclipse (3.2) was easy. But the current Octopus page on Sourceforge just said it is an ‘Eclipse plugin’. So I had to figure out how to install an Eclipse plugin first (but all I wanted was to run Octopus).

Finally I was ready and eager to use Octopus. Again, no hint on the Sourceforge site, nor in the plugin file. Fortunately I found the required information on the Octopus page on klasse.nl. I had to create a new Octopus project. Here is the result:

Problem opening wizard

Please note the helpful error message in the details window. If somebody out there knows how to run Octopus 2.2.0 on Eclipse 3.2 I’d appreciate some hints.

And could some kind soul please donate 200 bucks to the Eclipse foundation to sign their software?

eclipse.exe not signed

Technorati Tags: , ,

NASA uses model driven development for new software project

Tuesday, April 3rd, 2007

Hello!

Daniel Crook has posted an interesting article about NASAs decision to create the software for the James Webb Space Telescope with a model driven approach using UML with IBM Rationals product line. The original article on CNET also has some interesting comments. It would be interesting to see how the project runs.

Best regards,
Andreas

Technorati Tags: ,

What think experts about UML and modeling?

Tuesday, April 3rd, 2007

Hello!

The software development magazine SD Times has published an interview about the ‘Future of UML’ with some well known experts. I’d like to summarize and comment the interview for your convenience.

The participants where

  • Richard Soley (OMG Chairman and CEO)
  • Bran Selic (IBM, has made significant contributions to the UML metamodel)
  • Jack Greenfield (Microsoft – tool vendor)
  • Cris Kobryn (PivotPoint – tool user)
  • Jan Popkin (Telelogic – UML tool vendor)

Question 1: “What is the future of UML?”

Bran Selic says that the UML will be continuously maintained (interestingly, he did not say “developed”. Does this mean the speed of extension of the UML will be slower in the future? I think that would be beneficial for the acceptance of the UML). He also expects more and more people to use the UML more comprehensively e.g. for code generation and model verification. He also expects the publication of more UML profiles and thinks this a way of defining Domain Specific Languages (DSLs). I agree with this point, I also think that people underestimate UMLs extensibility and versatile applicability.

Jack Greenfield (naturally, since this is Microsoft’s official position concerning modeling methodologies) says that DSLs will be used more and more instead of UML for modeling software. UML will be used to design the DSLs themselves (I don’t think that Microsoft’s DSL tools borrow anything from UML. As usual, Microsoft tries to define their own standard).

Jan Popkin says that modeling will be important to communicate designs but the degree of coupling between the model and the code widely varies from modeling business processes (no direct relation to code) to embedded systems (highly coupled models and code).

Cris Kobryn thinks that model driven software development will become more and more important because the software industry matures. In the short term he is concerned about some shortcomings in the UML mainly “language bloat” and lack of diagram exchange in XMI 2.0. I think Cris’ opinion is the most unbiased and exact assessment of the current state of the UML.

Question 2: “How can development teams take better advantage of UML-based tools to improve the software development process?”

Jack Greenfield thinks that more usage of UML profiles will add precision to the model. Of course, he also thinks that DSLs are even better.

Cris Kobryn thinks that it is important, that the development team chooses a suitable subset of UML they want to use for the particular project. Sounds a bit like tailoring a development process and probably makes sense.

Bran Selic says that the best usage of UML depends on the degree of model driven development. Most important is that the development team realizes the value of modeling. In the past too much was promised but not enough value delivered.

Jan Popkin says that teams should try to use the UML stricter and stricter, thus becoming more comfortable with the language and the tools.

Question 3: “What role does modeling play in enhancing software security and compliance?”

Chris Kobryn says that a model driven development approach can be used to enforce certain security and compliance rules (I assume he thinks of the possibility to add security and compliance related aspects to the software using appropriate model transformations).

Jack Greenfield points out that a UML model can be used to make the softwares behavior concerning security and compliance better visible than just embedding it in code or XML configuration files (but, after all this is a primary benefit of modeling independent of security and modeling).

(Since UML as it stands is not specific to any technical aspect or domain this question seems a bit pointless to me. The answers seem to reflect this and are quite general).

Question 4: What drives development teams that haven’t previously used UML tools to adopt them?

The key drivers seem to be

  • Increasing software complexity
  • Less tolerance for errors
  • Better IDE integration of UML tools
  • Successful model driven projects by competitors

Jack Greenfield points out, that teams that have begun to use UML have often been disappointed because they found that UML is not able to effectively capture all relevant information.

Technorati Tags: , ,