Sunday, October 17, 2010

Software Engineering - A Recall..


                                    Best Practices of Software Engineering



Best practices are a set of commercially proven approaches to software development which, when used in combination, strike at the root causes of software development problems. They are observed to be commonly used in industry by successful organizations.

The above mentioned best practices are documented in The Rational Unified Process – An Introduction


A model is a complete description of a system from a particular perspective.
 
Diagrams are views of a model.



  •  Use-case diagrams illustrate user interactions with the system.
  •  Class digrams illustrate logical structure.
  •  Object diagrams illustrate objects and links.
  •  State diagrams illustrate behavior
  •  Component diagrams illustrate physical structure of the software.
  •  Deployment diagrams show the mapping of software to hardware configurations
  •  Interaction diagrams ( i.e. collaboratoin and sequence diagrams) illustrate behavior
  •  Activity diagrams illustrate the flow of events in a use-case.


An architectural view is a simplified description of a system from a particular perspective or vantage point, covering particular concerns and omitting entities that are not relevant to this perspective.



                  Representing Architecture: The 4+1 View Model

Logical View – addresses the functional requirements of the system.

Implementation view
– describes the organization of static software modules in the development environment, in terms of packaging, layering and configuration management.

Process view – addresses the concurrent aspect of the system at sun-time: tasks, threads or processes, and their interactions. 

Deployment view – shows how the various executables and other run-time components are mapped onto the underlying platforms or computing nodes.


                                         Analysis Versus Design

Analysis, focus is on understanding the problem

Design, focus is on understanding the solution


Monday, September 27, 2010

Configuring TestNG in Eclipse



Installing TestNG


Installing Eclipse Plugin for TestNG

1.       Download the TestNG eclipse plugin from (http://beust.com/eclipse/)
2.       Copy the downloaded jar file into following directory structure



3.       Create the “TestNG.link” file in ‘links’ folder of Eclipse installation
4.       Edit the file to provide the path of plugin
path=C:/Eclipse - Helios/eclipse-jee-helios-win32/eclipse/ExternalPlugins/TestNG
5.       Restart the Eclipse.




Verifying Installation

1.       Open Windows -> Show Views -> Others  to see if TestNG is listed as follows

Testing ( A simple Example )


1.       Create a TestNG class. 




2.       Specify the following details.  For more details on the annotations visit the TestNG site. They are pretty much same as Junit annotations.

3.       You also need to add the ‘testng.jar’ file so that the annotations can be recognized. In order to add this to your projects classpath. Select ‘Configure Build Path -> Add Variable -> Select the TESTNG_HOME -> Extend Variable to include testng.jar’




4.       Following generated Class should now be compiled

5.       Creating a ‘Launch Configuration’

6.       In the launch configuration select the TestNG class













7.       Select ‘Run’ from the launch configuration. You should see following in the “TestNG” dialog

8.       Above steps tested a method “f()” . The test was successful because there was no error or exceptions encountered in the method “f()” .
9.       Now intentionally modify the method to throw a new RuntimeException.
10.   Run the same Launch Configuration, and see the test results as below


Sunday, August 22, 2010

Validating XML against schema - Visual Studio 2008

This section assumes that schema, is present in local system.
For validating XML through schema, you have to specify below two attributes in root element of XML document.

1. Using absolute path
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.example.com/ file://C:/schema/test/SampleOne.xsd'

2. Using relative path
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.example.com/ ./SampleOne.xsd'

Suggested Reading
http://www.wrox.com/WileyCDA/Section/Editing-XML-and-XML-Schema-in-Visual-Studio-2008.id-320326.html

Tuesday, May 11, 2010

COBOL programs for windows

Most of the enterprise code till date is still in COBOL. Understanding COBOL is a good experience, and can be an arrow in your sheath.

I used Fujitsu NetCobol for running sample COBOL programs on windows. The IDE it provides is built on eclipse platform and thus is convenient for a person already using eclipse, RAD or similar IDE..
For now running COBOL programs seems to be fun and learning... :)

Determining version of compiled class..

Came across an issue which involved determining on what version a particular file was compiled. There is one nice utility that comes with JDK, which allows to get this information from class file.

Usage:
javap -verbose

if you want to redirect output to a text file.

javap -verbose TestClass >> output.txt