Software Engineering Tools

  • Ants – Ant is a Java-based build tool. In theory, it is kind of like Make, without Make’s wrinkles and with the full portability of pure Java code.
  • Cobertura – Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
  • Emma – EMMA is an open-source toolkit for measuring and reporting Java code coverage. EMMA distinguishes itself from other tools by going after a unique feature combination: support for large-scale enterprise software development while keeping individual developer’s work fast and iterative. Every developer on your team can now get code coverage for free and they can get it fast!
  • JavaNCSS – Ever wondered how many lines of code or how many classes there are in  the Sun JDK? Curious about the size of your own projects – or do you want to keep track of your work-progress. That’s what JavaNCSS is for. JavaNCSS is a simple command line utility which measures two standard source code metrics for the Java programming language. The metrics are collected globally, for each class and/or for each function.
  • Jester – The JUnit test tester. Jester finds code that is not covered by tests. Jester makes some change to your code, runs your tests, and if the tests pass Jester displays a message saying what it changed. Jester includes a script for generating web pages that show the changes made that did not cause the tests to fail.
  • Clover – Clover measures code coverage generated by system tests, functional tests or unit tests, allowing you to improve test quality and find bugs sooner.
  • A list of static source code analysis tools for C

Software Engineering Resources

  • Junit.org – This site is dedicated to software developers and testers using the JUnit testing framework. In addition to the latest news and download links for JUnit, you can find answers to questions about automated testing, tools and extensions for JUnit, and articles on Test Driven Development and other testing topics.
  • httpunit.org – Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links. When combined with a framework such as JUnit, it is fairly easy to write tests that very quickly verify the functioning of a web site.
  • EasyMock – EasyMock provides Mock Objects for interfaces in JUnit tests by generating them on the fly using Java’s proxy mechanism. Due to EasyMock’s unique style of recording expectations, most refactorings will not affect the Mock Objects. So EasyMock is a perfect fit for Test-Driven Development.
  • Refactoring – This site is a simple portal for information about refactoring. There is a list of sources of information about refactoring, including various books that have been written.
  • User Interface Design Patterns – This collection consists of user interface design patterns (interaction patterns) that seems to be recuring problems when trying to make design based on the user’s goals. These design patterns have been analyzed during the past five years by going through hundreds of designs, to give instructions and design examples to the students of design courses at the University of Helsinki, Dept. of Computer Science.
  • A Summary of Principles for User-Interface Design – This document represents a compilation of fundamental principles for designing user interfaces, which have been drawn from various books on interface design, as well as the author’s own experience. Most of these principles can be applied to either command-line or graphical environments.
  • User Interface Design Tips, Techniques, and Principles – A fundamental reality of application development is that the user interface is the system to the users. What users want is for developers to build applications that meet their needs and that are easy to use. Too many developers think that they are artistic geniuses – they do not bother to follow user interface design standards or invest the effort to make their applications usable, instead they mistakenly believe that the important thing is to make the code clever or to use a really interesting color scheme. Constantine points out that the reality is that a good user interface allows people who understand the problem domain to work with the application without having to read the manuals or receive training.
  • DreamSpark – Microsoft professional-level developer and design tools provided at no charge for students
  • Struts Framework – An open source framework for building Servlet/JSP based web applications based on the Model-View-Controller (MVC) design paradigm. A free pdf version of book “Starting Struts 2” is available at here.
  • JSP Tutorial – This tutorial teaches JSP by progressing from very simple examples to complex examples.
  • AJAX Tutorial – AJAX Tutorial for Java Programmers

Software Engineering Articles

Software Engineering Books

Quick Guide to nawk

Here is a quick guide to nawk. nawk as it has more functionalities over awk. Most systems now would have both programs installed. See also:

To run nawk

  • From command line : nawk ‘program’ inputfile1 inputfile2 …
  • From a file : nawk -f programfile inputfile1 inputfile2 …

Structure of nawk program

  • A nawk program can consist of three sections: nawk ‘BEGIN{…}{… /* BODY */ …}{END}’ inputfile
  • Both ‘BEGIN’ and ‘END’ blocks are optional and are executed only once.
  • The body is executed for each line in the input file.

Field Separators

  • The following example adds the field ‘=’ separator, in addition to the blank space separator: nawk ‘BEGIN{FS = ” *|=”}{print $2}’ input file.
  • For example, if the input file contains the line “Total = 500”, then the output will be 500.

Printing Environment Variables

  • The following example appends the current path to a list of filenames/directories:
    ls -alg | nawk ‘{print ENVIRON[“$PWD”] “/” $8}’
  • ENVIRON is an array of environment variables indexed by the individual variable name.
  • The variable FILENAME is a string that stores the current name of the file nawk is parsing.

Examples of usage

  • To kill all the jobs of the current user : kill -9 `ps -ef | grep $LOGNAME | nawk ‘{print $2}’`

Multi-dimensional array

  • To use 2D or multi-dimensional array, use comma to seperate the array index: matrix[3, 5] = $(i+5)

Another examples

  • The example below calculates the averages for 16 items from 10 sets of readings.
  • Example of an input line the program is trying to match: Total elapsed time is 560
BEGIN{
  printf("--------- Execution Time -----------\n");
  item=16;
  set=10;
}
{# all new variables are initialized to 0for(;j < set;j++)
  for(i=0;i < item; i++)
  {# skip input until the second word matches "elapsed"while($2 != "elapsed")
  getline;# notice the use of array without declaring its# dimensionsum[i]+=$5;
getline;
  }

if(j==set){for(i=0;i < item;i++){
   
  # this and the next 2 lines are comments
  # you can use either print or printf for output 
  # print sum[i]/set;
   
  printf("Set %d : %6.3f\n",i,sum[i]/set);
}
j++;
  }
}END{
  printf("-------------- End --------------");
}

Examples from the man page

  • Write to the standard output all input lines for which field 3 is greater than 5:
    $3 > 5
  • Write every tenth line:
    (NR % 10) == 0
  • Write any line with a substring matching the regular expression:
    /(G|D)(2[0-9][[:alpha:]]*)/
  • Print any line with a substring containing a G or D, followed by a sequence of digits and characters:
    /(G|D)([[:digit:][:alpha:]]*)/
  • Write any line in which the second field contains a backslash:
    $2 ~ /\\/
  • Write any line in which the second field contains a backslash (alternate method). Note that backslash escapes are interpreted twice, once in lexical processing of the string and once in processing the regular expression.
    $2 ~ “\\\\”
  • Write the second to the last and the last field in each line, separating the fields by a colon:
    {OFS=”:”;print $(NF-1), $NF}
  • Write lines longer than 72 characters:
    {length($0) > 72}
  • Write the first two fields in opposite order separated by the OFS:
    { print $2, $1 }
  • Same, with input fields separated by comma or space and tab characters, or both:
    BEGIN { FS = “,[\t]*|[\t]+” }{ print $2, $1 }
  • Add up first column, print sum and average:
    {s += $1 }END{print “sum is “, s, ” average is”, s/NR}
  • Write fields in reverse order, one per line (many lines out for each line in):
    { for (i = NF; i > 0; –i) print $i }
  • Write all lines between occurrences of the strings “start” and “stop”:
    /start/, /stop/
  • Write all lines whose first field is different from the previous one:
    $1 != prev { print; prev = $1 }
  • Simulate the echo command:
    BEGIN { for (i = 1; i < ARGC; ++i) printf “%s%s”, ARGV[i], i==ARGC-1?”\n”:””}
  • Write the path prefixes contained in the PATH environment variable, one per line:
    BEGIN{n = split (ENVIRON[“PATH”], path, “:”) for (i = 1; i <= n; ++i) print path[i]}

Quick Guide to Emacs

Here is a quick guide to emacs. These are a collection of commonly used keystrokes. See also:

Key Definitions

  • Ca-Cb : Press [Control][a] follow by [Control][b].
  • Ma-b : Press [Esc][a] follow by [b].
  • F1-t : Press function key [F1] follow by [t].

Tutorial

  • Please go through the Emacs tutorial If you haven’t done so: Ch-t or F1-t

Useful things to put in .emacs

  • Show line number : (line-number-mode 1)
  • Show column number : (column-number-mode 1)
  • Show time : (display-time)
  • Change color theme: (load-theme ‘deeper-blue t)
  • The list of default color themes besides “deepter-blue” includes:
    • adwaita
    • deeper-blue
    • dichromacy
    • leuven
    • light-blue
    • manoj-dark
    • misterioso
    • tango
    • tango-dark
    • tsdh-dark
    • tsdh-light
    • wheatgrass
    • whiteboard
    • wombat

Navigations

  • Quit : Cx-Cc
  • Move between windows : Cx-o
  • Goto a line : Mg

Editing

  • Cut : Ck
  • Paste : Cy
  • Select/mark region : C[space]
  • Exchange mark and point : CxCx
  • Cut rectangle region : Cx-Rk
  • Paste rectangle region : Cx-Ry

Search

  • Quick search forward : Cs
  • Quick search backward : Cr

Keystroke Record/Playback

  • Record : Cx-(
  • Playback : Cx-)

Various Different useful modes

You can enhance XEmacs with various useful features. The following two packages can be installed with minimal effort. Email me if you require any help in installing them.

  • Flyspell : On-the-fly spelling checker.
  • X-Symbol : Enables the showing of superscript, subscript and greek characters in LaTex.

To check for grammar errors in Latex, the best way is to convert your Latex document to HTML and use one of the online Grammar checkers.

Quick Guide to CVS

Here is a quick guide to setting up and using CVS. The commands shown below were tested on Concurrent Versions System (CVS) 1.10 available from Cyclic Software.

See also:

Setup

  • Set CVSROOT to a directory (e.g. setenv CVSROOT ~/cvsroot )
  • Run “cvs init”

Put Project into CVS

  • To add version control for a project consist of multiple files in a directory, e.g. ~/project
  • cd to ~/project
  • Run “cvs import -m “Project” myproject sample start”
  • The respective arguments are :
  • cvs -m “Log message” repository vendor-tag release-tags
  • You can put anything you like for the tags and log message.
  • You will need to use “repository” to checkout your files later.

Checkout a Project

  • To checkout a project
  • Run “cvs checkout myproject”
  • You can subsitute “myproject” for any other repositories in the CVS.

Update a Project

  • To update a project after modifying several files
  • Run “cvs commit”
  • An editor will be shown to allow you to add comments on the changes
  • To use another editor eg: xemacs, do “setenv EDITOR xemacs”

Add/Remove File

  • To add a file, run “cvs add filename; cvs commit”
  • To remove a file, run “cvs remove filename; cvs commit”

Topics not covered here

  • Version branches
  • Multiple developers

See also this site for a more comprehensive tutorial.