The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Tools for Testable Software Development

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Steven E. Newton

Posts: 137
Nickname: cm
Registered: Apr, 2003

Steven E. Newton is an independent consultant in Portland, Oregon.
Tools for Testable Software Development Posted: Jan 13, 2004 9:18 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Steven E. Newton.
Original Post: Tools for Testable Software Development
Feed Title: Crater Moon Buzz
Feed URL: http://www.cmdev.com/buzz/blosxom.cgi?flav=rss
Feed Description: Views and experiences from the software world.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Steven E. Newton
Latest Posts From Crater Moon Buzz

Advertisement

Software needs testability built-in. Automated testing is of critical importance in effective software development. Testing through the user interface is problematic at best, successfully automating this kind of testing is full of difficulties. Code can have testability hooks built in, to help find errors using automated methods. This project explores some ways to design and implement testability in any software in a broadly applicable way. A primary goal is to explore a test support library that can be incorporated into any application.

Background

In the context of discussing how to manage and administer deployed production software, an organization needs to have some "levers and knobs" to turn. In other words, "Put a power meter and steering wheel on every Web service". It should be possible to ask, "Who's using the service? How often are they requesting it? How many requests succeed? How many fail?". In order to do this, he lists three needs [Schadler03]:

  • visibility
  • accountability
  • hands-on control
In testing software, the development organization needs similar knobs, levers, and meters on the software to ensure that it functions as desired.

The Test-lead Sink

We take as metaphors two ideas from the hardware world. First, build in test leads or test points in a manner similar to those in in chips and circuit boards. Second, provide a sink into which test results can be sent. The sink would be something like a monostate object -- one which can receive and act on inputs but which does not itself change state. To get different behaviors, multiple sinks can be attached to or listen to the testing result outputs.

The input to the sink would look something like this:

  • static Map (Set) of key value pairs
  • Each value must have some kind of TypeAdapter
 MonitoredEvent
   key
   value or typeAdaptedValue
Sinks would be Testable-event observers, e.g. have a method something like
 postMonitoredEvent(MonitoredEvent evt) {
    ...
 }
Things to send to test lead sink:
  • object creation events (only for key resource allocation classes)
  • call to monitored method
  • semantically significant failures
  • significant state change (of a class or the system)
Many of the events will be recorded an accumulator and min/max extremes may be recorded. For example, as an important dynamic collection changes, we may want to know the number of elements and the high/low water marks.

Types of monitored values

  • initialization
  • configuration values
  • shutdown
  • outputs
  • side effects
  • internal states
  • probes -- an assertion that, when it fails, generates an error event that gets logged
  • Performance
  • # of operations over time
  • Resource Usage
  • high and low water marks & 1000 lt;/li>
  • audit
  • transaction completion
  • aggregates (what do I mean by this?)
  • suspect events
  • errors
This would be a dynamic and real-time display of the sort of information that can be generated by log analysis.

The test lead sink should be switchable at run-time. The whole facility can be turned on and off, and it should have "quiet", "normal" and "verbose" modes.

Generating a reasonable, understandable, clear, and simple display of the collected test information is important and potentially difficult.

References

[Pettichord02] Pettichord, Bret. ''Design for Testability''

[Robinson03] Robinson, Harry. "Predicting the Future of Testing"

[Schadler03] Schadler, Ted. principal analyst, Forrester Research Commentary: Ten tips for killer Web services

Commentary

Testers will want to be able to poke state changes into the objects under test. One way to enable this would be to have a way build mock objects and push them into the We'd like to be able to dynamically swap them in for testing purposes. There is a certain overlap between building in this kind of testability and building in monitoring for production operations. Having something that people can see serves two purposes and lowers the barrier for doing either of them.

Read: Tools for Testable Software Development

Topic: My Blogshares and Extelligence Previous Topic   Next Topic Topic: Easily build complicated SELECT statements with Squiggle

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use