spurperl has asked for the wisdom of the Perl Monks concerning the following question:

My question concerns Automatic Test Pattern Generation with Perl.

ATPG is very useful to test both software and hardware - creating test files in some meaningful way greatly aids one to test the various behaviours of her programs/designs.

I'd like to know more about it... Google search yielded a few interesting papers, but barely any code and nothing from the Perl community.

Perl is surely one of the most popular tools for this job, so people must have experience with Perl ATPG. Any tips ?

update (broquaint): title change (was ATPG in Perl)

  • Comment on Automatic Test Pattern Generation in Perl

Replies are listed 'Best First'.
Re: Automatic Test Pattern Generation in Perl
by rob_au (Abbot) on Jul 17, 2003 at 05:30 UTC

      I wouldn't class the sort of thing Ovid was talking about as ATPG. You're not generating the tests - you're writing them yourself. With ATPG you're creating test patterns algorithmically.

      In fact I've not come across the term ATPG outside the hardware world (something I'm only vaguely familiar with because my younger, smarter, better looking brother is an EE :-).

      As I understand it you use various algorithms to generate patterns of voltages to find potential faults in your circuit. There are big commercial systems for doing this like TetraMAX and FastScan, but people do write their own - in Perl and other languages.

      For example if you search for Perl in this document you'll find some people using Perl to generate code for MacroTest (an optional part of FastScan).

      There's a hell of lot of research in the area because hardware test cycles can burn up a hell of a lot of development time. However I don't know hardware so I can't offer any pointers.

Re: Automatic Test Pattern Generation in Perl
by antirice (Priest) on Jul 18, 2003 at 01:07 UTC

    I actually helped a professor of mine with creating a program that does this, but in Java. To brush up on the subject, he offered a number of IEEE papers and books to read. Most of the papers I read on the subject were pretty much garbage. Also, there were a lot of bad books on the subject. The best book, IMHO, turned out to be Testing Object-Oriented Systems: Models, Patterns, and Tools by Robert Binder. It weighs in at roughly 1248 pages. Despite the title, he does cover some methods for functional programming. However, the area of OO testing is just amazing. Towards the end of the book are some methods of automating the testing process.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1

Re: Automatic Test Pattern Generation in Perl
by adrianh (Chancellor) on Jul 18, 2003 at 10:08 UTC

    spurl would it be possible for you to clarify your question a bit? Are you asking about:

    ATPG?
    Which I still think is a hardware only term (pattern - referring to pattern of voltages to pins AFAIK). If you're come across it used as a term to describe software testing any references would be appreciated
    Generating tests algorithmically?
    Which is a well accepted technique. Take a look at the number tests in Regexp::Common for some examples. You need a way of generating possible values and a mechanism (sometimes called an "oracle") that lets you know whether the test should pass or not.
    Having automatic rather than manual tests?
    In which case you should take a look at Test::Tutorial, Test::More and friends in the Perl world.

    If you want to learn more about software testing in general I'd recommend Kent Beck's Test Driven Development and Cem Kaner & James Bach's Lessons Learned in Software Testing: a Context-driven Approach.

      Patterns = test vectors for hardware, yes. But not in the electrical sense - in the simulation sense. Instead of supplying manually various inputs to a model under test, use a script that supplies it with vectors, and tests for correct values at the outputs.

        Ah, so when you said "software" in your OP you were referring to hardware models - sorry misinterpreted.