Basic Hudson/Jenkins tutorial

hudson-bustContinuous Integration is a great thing. Allows you to monitor your project state on a commit-by-commit basis. Every build failure is monitored easily.

If you connect your unit and integration tests properly also tell your runtime properties of the project, for example:

  • Does it boot properly?
  • Doesn't it crash in 1st 5 minutes?
  • Are all unit tests 100% green?
  • Are all static tests (think: FindBugs, lclint, pylint, …) free of selected defect types?

The implementation:

  • you encourage your team to push changes frequently to main development branch (having high quality unit testing suite you can even skip topic branches policy)
  • you setup some kind of Continuous Integration tool to scan all the repositories and detect new changes automatically
  • for each such change new build is started and tests are carries out automatically
  • all the build artefacts (including tests outcomes) are collected
  • the teams are notified by e-mail about build/test failures in order to allow them to carry out fixes quickly

OK, so we have outlined the plan above. Let's dig into details for every step. I'll use the most popular tool used named Hudson/Jenkins as implementation tool (there are two projects, but they're, actually, the same tool).

I'm going to address all the features I expect from continuous integration system (based on my current experience with other CI systems).

Continue reading

Posted in en | Leave a comment

CMake very basic tutorial

slider-cmakeWriting Makefiles is a complicated process. They are powerful tools and, as such, show quite high level of complexity. In order to make typical project development easier higher level tools have been raised. One of such tools is CMake. Think of CMake for Make as C/C++ compiler for assembly language.

CMake transforms project description saved in CMakeLists.txt file into classical Makefile that could be run by make tool. You write your project description in a high level notation, allowing CMake to take care of the details.

cmake_workflow Continue reading

Posted in en | Tagged , | Leave a comment

An Easy Executable Software Specification – A Proposal

Executable Specification 1Executable specification is a "holly graal" of modern software engineering. It's very hard to implement as it requires:

  • Formal specification of rules
  • Transformation of those rules into real-system predicates
  • Stimulating system under tests state changes in repeatable manner

FitNesse is one of such approaches that specifies function sample inputs and outputs then allow to run such test cases using special connectors and provide colour reports from test runs. It's easy to use (from specification point of view), but has the following drawbacks:

  • Software architecture must be compatible with unit testing (what is very good in general: cut unnecessary dependencies, Inverse of Control, …) – your current system might require heavy refactoring to reach such state
  • Rules are written and evaluated only during single test execution – different scenario requires another test case (no Design By Contract style continuous state validation)

Above features are present in any other unit test framework: JUnit, unittest, … All such testing changes state and checks output.

Continue reading

Posted in en | Leave a comment

Conflicting DHCP server locator under Linux

cable-ethernetIn order to locate conflicting DHCP server in your LAN execute the following command:

sudo dhcpdump -i eth4 | awk '/IP:/{SRC=$2 " " $3} /OP:.*BOOTPREPLY/{ print "DHCP server found:", SRC; }'

The restart your PC network (use DHCP to get new IP). If you see more than one IP address here:

DHCP server found: 192.168.4.1 (0:9:6b:a3:fc:4a)
DHCP server found: 192.168.1.1 (f8:d1:11:9e:1d:8b)
DHCP server found: 192.168.4.1 (0:9:6b:a3:fc:4a)
DHCP server found: 192.168.1.1 (f8:d1:11:9e:1d:8b)
DHCP server found: 192.168.4.1 (0:9:6b:a3:fc:4a)

Then you have two, conflicting DHCP servers in your network. You can use http://www.coffer.com/mac_find/ tool to locate the device type that causes the problems.

Posted in en | Tagged , | Leave a comment

Setting up proper terminal size for serial connection to an embedded device

consoleWhen you work over serial line on an embedded device usually the terminal size it set to 80×25.

There's an easy way, however, to setup your real terminal size, just add the following line to your profile script (~/.profile):

resize > /tmp/resize
. /tmp/resize

resize command detects real terminal size and sets COLUMNS and ROWS parameters accordingly:

# resize
COLUMNS=159;LINES=52;export COLUMNS LINES;

One just need to execute the output as sh commands (using source "." command).

Posted in en | Leave a comment