Test EarlyTest EarlyThis blog is written by the employees of Stelligent Incorporated. We are passionate about building software quality into the development process using the right tools and processes for the occasion. We seek to make code more defect-resistant and enjo Articles
Forcing build failures with simple thresholds
2007-03-11 00:40:02 Automated build systems (like NAnt or Ant) are excellent mechanisms with which to incorporate quality gates. An obvious quality gate is a successful test run (i.e. did all developer tests pass?); however, with the incorporation of software inspectors, you can introduce additional quality gates that verify specific code metrics or even combinations of metrics. Some software inspectors, in fact, already have built in mechanisms to cause build failures if specific thresholds are exceed, like Cobertura, which has a cobertura-check task that checks specific coverage values. If a particular tool doesn’t provide an automatic failure hook, you can easily build one– in fact, combining Groovy’s expressive scripting power with Ant makes this process quite easy. For example, you can audit a JavaNCSS (a software inspector that reports code size and complexity) report and fail a build if the maximum complexity (which is reported for individual methods) is exceeded. Imagine that ... More About: With , Simp , Failure , Simple , Build
Getting Fit with .NET
2007-03-07 00:36:02 FitNesse, a popular Web-based test and collaboration server, is an enhancement to Fit (Framework for Integrated Testing) and an invaluable way to collaborate on complicated problems early in development. In January, Gojko Adzic published a free tutorial (PDF) ‘Getting Fit with .NET’ to get you on your way to testing .NET applications with FitNesse. Available online and updated last month to cover Fit.NET 1.1 including a new chapter on DoFixture, working with arrays and business objects, topics include: Setting up a FitNesse server for testing .NET code Writing basic tests, performing common tasks Tips and tricks for writing better tests and making test pages easier to read Managing content with FitNesse Organizing tests into test suites Most important differences between .NET and Java versions Definitely check it out if you’re considering using (or already are using!) FitNesse in your projects. In related news - Adzic has also released DbFit, an extension o... More About: With
The new cruiseControl 2.6.1
2007-03-07 00:36:02 The new cruisecontrol 2.6.1 includes 3 bug fixes and a Veto powered plug-in designed to fix multiple build dependencies. * Fixed problem with RMI clients where ProjectConfig was not Serializable * Fixed problem with NullPointerException writing to the log file if the config file was reloaded in the middle of a build. * Fixed an error loading the metrics page of the report when the jaxen jar is not in the path The Veto plug-in will check to see if a given target project is up to date with the latest changes and if not, will “Veto” the current build attempt. This Keeps projects that are dependent on one another in the correct build order. More About: The N , Control , Cruise , Econ
Type Checking and Maintainability
2007-02-26 12:29:13 Maintainability is an important factor in every software project. The costs of not getting it right run high. In fact, it is estimated that maintainability costs are often 70%-80% of a total project cost. The main principle of maintainable code is to design loosely-coupled components with small number of connections to other functions. Factors such as solid Object-Oriented Analysis and Design (OOAD) and design patterns impact long term code maintainability. Diomidis Spinellis [1] lists other important factors that affect maintainability. Among these factors are analyzability, consistency, length of expressions, functions, and methods, locality of dependencies and type checking. If data abstraction is a policy promoting (among other things) a system’s stability and maintainability, type-checking is the enforcement mechanism. An implementation that takes advantage of a language’s type-checking features will catch erroneous modifications at compile time; an implementation b... More About: Main , Check , Type , King , Bili
Are you taking to testing?
2007-02-25 00:27:05 David Rubinstein, of SD Times, has published an excellent editorial entitled “Taking to Test ing ” in which he summarizes a Web seminar where developer testing was addressed. He specifically writes that the benefit of testing during coding (as opposed to after things are complete) is more value from the business system being delivered. If ROI is a function of a system’s cost to develop versus the value it delivers to the business, lower development costs translate to higher value. Well said, Mr Rubinstein. More About: King , Sting
Testing Ajax?
2007-02-25 00:27:05 I ran across an interesting article entitled “Improving Test Coverage of Ajax Applications” in which the author likens the challenges of testing Ajax applications to that of testing traditional GUI apps. While some newer frameworks (like Selenium) are positioned to actually verify Ajax-ian behavior, they can lead to a false sense of security because of the complexity associated with the combination of actions in using a GUI. While Ajax applications are definitely more snazzy than traditional web apps, because they can alter the traditional notion of page flow, one must put some extra thought into how the application will be verified. More About: Testing , Sting
JUnit 4 Tutorial
2007-02-23 12:26:03 Let’s face it, JUnit has become the de facto standard for Java technology testing. Sure there are other powerful test frameworks (TestNG!), but they’ve never enjoyed the broad acceptance JUnit has, especially since the ingenious new version was released last year. Andrew Glover recently published a tutorial: Jump into JUnit 4. A supplement to his popular ?In pursuit of code quality? series, the tutorial published by IBM developerWorks guides you step-by-step through the fundamental concepts of JUnit 4, with emphasis on the new Java 5 annotations. At the conclusion of this one-hour tutorial, you will understand the major changes to JUnit 4, as well as being familiar with features such as exception testing, parametric testing, and the new flexible fixture model. Last but not least, you will know how to do the following: * Declare a test * Use annotations to logically group tests prior to running them * Run tests in Eclipse 3.2 or Ant, as well as from the... More About: Tutorial , Tori , Rial
Integrating Maven 2 with CruiseControl Podcast
2007-02-22 00:25:02 In the fourth edition of the Stelligent Early Quality Pod cast Series, Paul Duvall and Levent Gurses discuss how Continuous Integration can be simplified with two popular tools: CruiseControl and Maven 2. If you’re looking to intensify your CI and testing process or are curious about how these tools can help, this podcast is a valuable resource. Also, check out the other editions in the series. Each podcast is about 5 minutes and each feature an informal conversation between two or more software professionals on technologies and solutions relating to early software quality. More About: Podcast , With , Cast
It?s all about the process template?
2007-02-20 06:23:02 If you want to modify your team system project, you really need to get comfortable with the process template. You can download a template editor from http://www.imaginets.com. Once you’ve got the template editor, your first step is to download either the Agile or CMMI default process template to your local machine. On the tool bar within Visual Studio, go into the Team menu, Team Foundation Server Settings, Proc ess Template Manager. Choose your template and click download. This automatically creates a folder and the xml template is inside the folder. Next, go into the Process Template Editor, click open, navigate to where you downloaded the default template and click open. Now, let’s say you want to modify the workflow for tracking a bug. Double-click on Work item tracking to expand the directory, then click on Work Item Type Definitions. You will see Bug, Task, Quality of Service Requirement, Scenario and Risk. Open the bug work item definition, click on the work ... More About: About , Plat , Late
Making NAnt more expressive with Boo
2007-02-20 06:23:02 Boo provides the ability to script with a more expressive language in NAnt build files via the boo task. As an example of the possibilities of what you can do with Boo in NAnt, check out the following two tasks, which first runs FxCop and then reads the output of a FxCop task so as to summarize the number of Critical Errors in FxCop’s result file. <property name="fxcop.xml" value="${build.dir}bin${build.config}fxco p.xml"/> <target name="fxcop" depends="build"> <fxcop> <targets> <include name="${build.dir}bin${build.config}${lib rary}" /> </targets> <arg value="/out:${fxcop.xml}" /> </fxcop> </target> <target name="fxcop-analysis" depends="fxcop"> <boo> import System.IO fpath = Project.Properties['fxcop.xml'] numerror = 0 using input = File.OpenText(fpath): for line in input: if line =~ /Level="CriticalError"/: numerror++ print("There were ${numerror} Critical Er... More About: Press , With , King , More , Xpress
What do you mean Microsoft Team System doesn?t support Continuous Integrati
2007-02-16 06:19:01 Okay, okay…Team Foundation Build has no built-in support for continuous integration, but even Khushboo Sharan, Program Manager, Visual Studio Team System acknowledges the advantages of Continuous Integration and explains how he sees Continuous Integration Using Team Foundation Build working. More About: Microsoft , Port , What , Hat
Booing IE automation
2007-02-11 18:16:02 Boo is statically typed language for the .NET platform inspired by Python– with Boo, you can write functioning .NET applications quickly. If you have a handle on Python or even VB, then picking up Boo is anything but scary. Boo has a host of features including built in Regular Expressions, collections, and closures; in fact, even though it is Pythonic in nature, it reminds me a lot of Groovy in that the language is unique to itself and not a cousin of some other language like Jython is Python or JRuby is to Ruby. Recently, I found myself needing to script out some functional tests via Internet Explorer. I considered using Watir; however, I wanted to see what I could knock out with Boo due to its close integration with the Windows platform. As it turns out, Boo’s closeness to Windows makes IE automation so easy it’s almost…well, frightening. The only, err….terrifying aspect of using IE automation in Boo is learning mshtml, which isn’t as documented... More About: Auto , Automation
Testing GUI applications with TestNG
2007-01-29 06:06:05 Developer testing of GUIs, like those written in Swing for example, have always been a challenge. Regardless of how a particular GUI is coded, ascertaining testing plug-in points and determining how to structure a particular test case presents barriers that often force one to postpone testing until a more manual effort can be conducted. As I mentioned a few months ago, there are a number of frameworks available that facilitate testing various GUI frameworks; however, of late, I have found that one particular framework for testing Java GUIs stands out– testng-abbot. While the framework is fairly new and lacking of a lot of documentation, the features found in the latest version make testing a GUI (either AWT or Swing) quite easy. For example, testing the following scenario takes one test case and an associated fixture. Below is a sample Swing GUI that excepts two parameters representing a Widget’s name and weight. In a sunny day scenario, if a user enters a valid weight ... More About: Applications , Cat , Testing , With , Sting
4 steps to FxCop-NAnt nirvana
2007-01-25 18:04:01 FxCop is an easy to use static analysis tool, which scans .NET assemblies for violations to pre-defined rules (like naming conventions, security, etc)– while it is now bundled with VSTS, there are still plenty of NAnt-loving shops out there. If your .NET project uses NAnt as a build system and you’re looking for a quick mechanism to objectively look at your code base, then follow these four easy steps for FxCop-NAnt nirvana. First, you must download NAntContrib, which is a series of tasks not yet included in the core NAnt distribution. Inside this .dll are a series of tasks including fxcop, which of course, runs FxCop (assuming FxCopCmd.exe is in your PATH). The NAntContrib project, by the way, has a host of tasks for working with various CM systems like Perforce, Subversion, and ClearCase to name a few. Next, download FxCop, install it, and ensure that FxCopCmd.exe is in your PATH. Installing FxCop provides a rather nice GUI that can be run outside of a particular build... More About: Nirvana , Step , Steps
I like refactoring and I can not lie
2007-01-25 18:04:01 [Intro] Oh my goodness. Paul, look at that code. It’s so big. *scoff* It looks like one of those Fortran guys wrote it But, y’know, who understands those Fortran guys? *scoff* They only write that stuff because it looks like job security, ‘kay? I mean, that method, it’s just so big. *scoff*I can’t believe it’s so complex, it’s just out there I mean, it’s gross. Look! It’s just so…legacy [Sir Refactor-a-Lot] I like refactoring and I can not lie You other coders can’t deny That when a method uses too much space And its complexity is staring you in the face You get stung Wanna extract that stuff Cuz you know testin’s gonna be tough Deep in the logic it’s glaring I’m hooked and I can’t stop staring Oh, man I wanna get fixn’ And make that logic smaller My metrics tried to warn me But that mess its got Exploited that code’s frailty Ooh, extract method isolates that logic and makes testi... More About: Fact , Ring , Tori , Like , Factor
SD Times Web Seminars
2007-01-25 18:04:01 If you need a great source of problem-solving techniques and tips, best practices and up-to-date product information, check out BZ Media?s Web Semi nar s . Hosted by SD Time s and Software Test & Performance, these seminars offer real-time solutions to your software development problems. Here’s a sample of what’s coming up: Continuous Integrated Testing for .NET: What’s In It For You? TUESDAY, January 23, 2007 2:00 pm Eastern | 11:00 am Pacific You already know that it’s better, faster and cheaper to fix bugs early in your application development cycles. But the last thing you need is more work in your busy day. Enter Continuous Integrated Testing (CIT), an approach that combines development and testing practices and tools to let you test while you build, increasing quality and saving you time. Requirements-Driven Testing: The Journey From Business Needs To Test and User Acceptance TUESDAY, Feb. 6 2:00 pm Eastern | 11:00 am Pacific Learn concrete techniq... More About: Times
CruiseControl 2.6 released
2007-01-25 18:04:01 CruiseControl released a new version last week. There are some interesting new features: The Windows installer provides an option to install CruiseControl as a service New RakeBuilder tag A chart that displays Checkstyle, PMD and JavaDoc violations — over time I also noticed that CruiseControl is no longer providing support for Java 1.3. 1.4 is the new minimum JDK. These are exciting new features. I’ll provide more after I get a chance to try them out. More About: Released , Release , Cruise , Lease
What?s worse than finding a worm in your apple?
2007-01-25 18:04:01 How about 31 bugs? 2007 was kicked off with two independent security researchers, Kevin Finisterre and his accomplice who goes by the pseudonym LMH, publishing details of a flood of security vulnerabilities in Apple ’s products. Known as the “Month of Apple Bugs” and modeled after July?s “Month of the Browser Bugs” and November?s “Month of Kernel Bugs”, the project discloses a new security hole each day in January in Apple’s OS X operating system and the applications that run on top of it. Some experts and users have questioned the purpose of these projects, debating whether these Month of ‘X’ Bugs are helping security or hurting it. Finisterre and LMH argue that: Flaws that are publicly disclosed will get fixed quickly. InformationWeek editor, Larry Greenemeier, explored security researchers’ practices at length, exposing the risks they create but ultimately concluding it’s a necessary price to pay for g... More About: Worm , What , Hat , Your
Making JUnit 4 backwards compatible
2007-01-25 18:04:01 Because JUnit 4’s testing model has fundamentally changed due to the introduction of Java 5 annotations, many people have found that the extensive framework of runners, like Ant’s venerable junit task, don’t work. For example, running the following JUnit 4 test in Ant (pre 1.7) will yield some interesting results. import static org.junit.Assert.assertEquals; import org.junit.Test; public class SimpleTest { @Test public void verifySimpleAssert(){ assertEquals("simple test", "simple test"); } } Using the junit task in Ant yields the following errors: [junit] Running test.com.acme.SimpleTest [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.047 sec [junit] Testsuite: test.com.acme.SimpleTest [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.047 sec [junit] Testcase: warning took 0.016 sec [junit] FAILED [junit] No tests found in test.com.acme.SimpleTest [junit] junit.framework.AssertionFailedError: No tests found in test.com.acm... More About: Comp , War , Back , King , Ward
Out of the box test categorization in JUnit 4
2007-01-25 18:04:01 The newest version of JUnit does not contain a category annotation, like its rival Test NG or its distant cousin NUnit; however, this doesn’t mean you can’t easily categorize your tests. Much like pre-JUnit 4, the solution involves the use of suites; however, as anyone who is actually using JUnit 4 knows, suites, as we used to them, are history– they’ve been replaced with annotations. Briefly, in JUnit 4, suites have been replaced by two annotations: @RunWith and @SuiteClasses. The @RunWith annotation requires it be set to the Suite class and then the @SuiteClasses annotation accepts a list of class to be run. It is this annotation that facilitates test categorization– for example, to run all unit tests, you would list them all as follows: @RunWith(Suite.class) @SuiteClasses({AccountEqualsTest.class, UserTest.class, CalcTest.class}) public class AllUnitTests { } Likewise, for component or system tests , you would create similar classes using the @Suit... More About: Cat , Cate , Out of the box , Tego
It?s the FUNDAMENTALS, stupid!
2007-01-25 18:04:01 I avoid spending too much time in the philosophy of effective software development, but I felt inspired after reading some interesting threads recently on whether it’s tools, process or something magical that is the difference between a successful and a failed software development project. I find it somewhat amusing when some developers think that the latest programming language or methodology will not only enable us to write flawless code, but let us live in peace and harmony as well. Let me give you a hint: It will NOT! I am reminded of Coach John Wooden who led the UCLA Bruins to 10 NCAA championships. Coach Wooden focused on fundamentals. Some players want to focus on making a slam dunk or draining a three from 25 feet. However, Wooden’s philosophy was that fundamentals such as free throws, layups, and jump shots were most important. His players would consistently practice layups and free throws until it became second nature (a “non-event”). This is becau... More About: Fun , Mental , Men , Stupid , Fund
Boiling frogs and code metrics
2007-01-25 18:04:01 Over on Code Better.com, Jeremy Miller has an interesting post entitled “Are Code Statistics Useful?” in which he likens monitoring code metrics to boiling frogs: “If you drop a frog into boiling water he jumps right out. If you put a frog in cool water, then gradually heat the water to boiling, he won’t jump out.” The whole point being that if you don’t monitor metrics like Cyclomatic complexity, all of a sudden you could have a problem on your hands, especially when dealing with legacy code. What a great analogy! Jeremy’s posting is an excellent read; however, it’s unclear towards the conclusion if the measured Cyclomatic complexity values are for single methods or classes in the aggregate. Don’t forget to check out Raymond Lewallen’s posting entitled “Coupling, Abstractness, Stability - Measuring and Applying Code Metric s ” also on CodeBetter.com, in which he muses about coupling metrics. More About: Frog , Frogs
Improving code with Eclipse plugins
More articles from this author:2007-01-25 18:04:01 Paul Duvall published an article, Improving code with Eclipse plugins, the fifth installment of his “Automation for the people” series by IBM developerWorks, where he provides examples of installing, configuring, and using static analysis Eclipse plugins focused on helping developers in key areas such as: Coding standards Code duplication Code coverage Dependency analysis Complexity monitoring These code analysis areas can be uncovered with five helpful plugins: CheckStyle: For coding standards PMD’s CPD: Enables discovering code duplication Coverlipse: Measures code coverage JDepend: Provides dependency analysis Eclipse Metrics plugin: Effectively spots complexity Regardless if you chose one of the profiled tools or other Eclipse plugins, incorporating them into your work environment will contribute to real-time visual feedback on the state of the quality of your code so that you may prevent problems early in the development life cycle. More About: Plugins , With , Plugin , Clip 1, 2, 3, 4, 5 |



