Saturday, May 05, 2007

CSE7312 Project Progress

I've continued to make progress over this weekend (despite losing several hours cleaning up the blown over tree in my front yard). My goal is to be done with the coding be the end of the day Monday (three days ahead of my original goal).

At the end of Friday I had what I thought a daunting task ahead of me. All I had accomplished was reading in an XML file and turn that into an internal representation. I was worried because the meat of what I needed to do was still left to be done. After today I am much more optimistic. I've completed the real meat of the project which is discovering what requirements have Test Cases, which of those Test Cases have an associated JUnit test and executing the JUnit test. All that is left is to update the XML file and make the tool executable from Ant.

I've also started to gather together a number of to dos that should be addressed before this would become a viable tool for general use.

To Do
  • Implement the internal representation of the SysML in an embedded database such as JavaDB or Derby. This will make the code more flexible and allow more freedom in what objects and relationships are allowed (right now unknown relationships generate an error)
  • Convert it to use true XMI formatted files.
  • Make the tool smart enough to allow more than one Test Case with a JUnit test to be associated with a single requirement.
  • Make it smart such that if the same JUnit test is used across multiple Test Case objects, do not re-execute the test again.
  • Allow for the insertion of JUnit parameters (right now only the class name is supported)
  • Make use of the Ant JUnit task code to provide better integration with Ant (right now the task will run stand alone)
  • Make use of custom class loaders so a user can specify a different classpath for use when running JUnit tests
Because of the list of deficiencies listed above (none of which will be addressed for this project given the limited amount of time) this ant task will not be much more than a proof of concept. However, it does show that the concept is sound and the code is simple enough to easily expand to support the above features and more.

Finally, I'd like to mention a happy realization I came to. This is the first project I've use JUnit on and followed the "write the test first" methodology. I have been somewhat annoyed at the fact that my test cases are so much longer, tedious, and hard to maintain than the code (my main class s only 172 LOC whereas the JUnit test framework to t est it is 560 LOC). But there is one really nice thing that comes from the JUnit tests and that is the feeling one gets when the test passes, particularly when it passes unexpectedly. It is almost like getting three cherries on a slot machine. It also gives me confidence that what I have written works well enough to move on to the next part.

Labels:

Tuesday, March 13, 2007

CSE 7312 Project: First Posting

This is the first posting for my Systems Engineering for Software Intensive Programs project. I suppose the best place to start is a description of my project so here goes.

My project dove tails with Robert's project quite nicely and describing my project without discussing his isn't possible. So I'll describe the over all project and then drill down into my part.

Objective:
Our objective is to build a tool on top of the Eclipse, Ant, and JUnit Test systems that allow one to generate SysML diagrams complete with test cases. The test cases are linked to JUnit tests where possible. An Ant task is provided that will execute the JUnit tests and update the SysML diagrams indicating the success or failure of the test. The ultimate intent is to have a SysML diagram that is automatically kept up to date with the results of the tests so one can tell with a look at the SysML diagrams progress towards realizing the requirements of the system. Not all requirements are testable with a unit test and in those cases the diagram may need to be manually updated.

Project Breakdown:
The scope of this project is beyond what one individual can accomplish in the time allotted. Therefore the project is split roughly in half. Robert will be responsible for the Eclipse plug-in and the graphical interface. I am responsible for the Ant task, executing the JUnit testing, figuring out the mappings between the diagrams and actual JUnit Tests and updating the XML used to generate the SysML diagrams so the progress can be represented. We will have to work together to define the XML representation we will use to communicate between the two components (and ultimately the store the SysML).

Scope:
Obviously a fully functional and realized system that covers the entire SysML spec, saves everything in XMI and is possible to fully test and update for every requirement automatically is well beyond what we can accomplish. However we can make a good first step. The scope of my project will be the following:
  • definition of XML that the diagram is stored in (co developed with Robert)
  • mechanism for tying a JUnit Test to a requirement through a Test Case
  • mechanism for executing those JUnit Tests from Ant
  • mechanism for collecting the results of the JUnit Tests
  • mechanism for updating the XML that the diagram is stored in with the results of the JUnit Tests
Blog:
In the coming weeks, the progress made on this project will be posted to this blog.

Labels: