TacklingTheEncapsulationTestabilityTradeoff

From SPA Wiki

Jump to: navigation, search

Contents

WS7 - Tackling The Encapsulation Testability Tradeoff

Results:

The workshop had some good discussion, both during and immediately after.

I think most everyone agreed that

- Creating test extensions that are not part of the public API requires work-arounds and there could be better tool support. - When



Sources

I promised to put up my sources, so here they are. I will also post them here: http://mawi.org.

Most of the articles can be found via acm (portal.acm.org) or ieee, but I always search via acm.

Abstraction, information hiding and encapsulation

Most of the good stuff here is from different OOD books. Here are some old articles I found interesting, (tiny archaeological warning), worth skimming:

"Data abstraction and hierarchy" Barbara Liskov OOPSLA 1987

"Encapsulation and inheritance in OO programming languages" Alan Snyder OOPSLA 1986

"Encapsulation constructs in systems programming languages" W. F. Appelbe, A. P. Ravn ACM Transactions on Programming Languages and Systems (TOPLAS) April 1984

Parnas on information hiding is classic but the examples dated.

"On the criteria to be used in decomposing systems into modules" D L Parnas Communications of the ACM, December 1972

Abstraction is not mechanics of coupling, but is about semantics and meaning - designing is creating models that communicate:

Good vs. Evil: Abstraction Manuel Klimek, article on blog http://klimek.box4.net/blog/2007/03/18/good-vs-evil-abstraction/


Testability

If you read just one article on testability, Binders old from 12 years ago is the the best I've read. You will have to "translate" concepts to todays terms, and it pretty condensed (but it is at the same time not "being difficult"), read it twice.

"Design for testability in object-oriented systems" Robert V. Binder September 1994 Communications of the ACM, Volume 37 Issue 9

The first article I've read that actually talks about testability of software with respect to test creation in a pragmatic way, is Freedman. It is still interesting, although not as current. It's non OO and a bit silly on the math side, especially for a practicioner, but I just skim that...

Testability of Software components IEEE Trans. Software Eng. 17(6): 553-564 (1991) Roy S Freedman

Not so long ago I found an excellent recent summary of testability work, that I could have made good use of earlier. (Note the weird publishing spot.)

"Predicting Class Testability using Object-Oriented Metrics" Magiel Bruntink, Arie van Deursen September 2004 Proceedings of the Source Code Analysis and Manipulation, Fourth IEEE International Workshop on (SCAM'04) - Volume 00 SCAM '04

Magiel Bruntinks "Testability of Object Oriented Systems: a Metrics based approach" (dissertation, 2003) is pretty nice as well.

We talked about two basic models of testability, which were kind-of based on Binders categories of fault and conformance directed testing. A model of testability that focuses on fault directed testing is that of Jeffrey Voas. He has published alot, I found this article to be the most accessible:

"Software Testability: The New Verification" IEEE Software may 1995 Jeffrey M. Voas, Keith W. Miller

There are a couple of others worth checking out, this one is ok:

"Factors that affect software testability" Voas Jeffrey M. October 1991 Technical Report Publisher: NASA Langley Technical Report Server (available via acm)

Stefan Jungmayr has published alot and has focused on dependencies and metrics, this short article sums up alot of his work. Both this and more can be found on www.testability.de/E_index.html:

"Testability and unit testing" Stefan Jungmayr

His dissertation is lengthy, there is some useful stuff there. His clear definitions of dependencies are a good contribution.


Books

If you want a good and accessible text that does cover a lot of the issues we talked about, I really have found good use for Feathers "WELC" book. I recommend it to anyone learning behavior driven or test first design as well.

"Working effectively with legacy code" Prentice Hall, 2004 Michael Feathers

Chapters addressing test construction factors: Chapter nine and ten talks about controllability and a little about observability. Other chapters talk about design and abstraction, notably chapter 17. Great book on the subject of testing object oriented code, one of the best IMHO.

There's also Binders enormous book, which is not mentioned that often, so I'll mention it. The parts I've read are excellent, but it's quite enormous. He should have split it into several.

"Testing Object-Oriented Systems: Models, Patterns, and Tools" Addison-Wesley 1999 Robert V Binder



Testing general

I brought up some stuff (the testing periods, etc) from an old article that is really nice, and highly recommended, well worth a read. Short easy read that has many insights, although it is a bit historical.

The growth of software testing D. Gelperin, B. Hetzel June 1988, Communications of the ACM, Volume 31 Issue 6

(If anyone has access to the sciencedirect (I think it is called) repository that is holding the article "High-level testing and example-directed development of software specifications" (Probert / Ural) captive - I'm interested. It's from 1984 so it's presumably a purely archaeological read, but the title is intriguing at that date.)

This is an old classic and still very amusing read, could use another font:

"In defense of program testing or Correctness proofs considered harmful" Andrew S Tannenbaum et al ACM SIGPLAN Notices Volume 11 , Issue 5 (May 1976)

OO

I mentioned the study on core OO concepts:

"The quarks of object-oriented development" Deborah J. Armstrong Communications of the ACM archive, February 2006


TOOP - Testable object oriented programming

There has actually been some work on what testable object oriented programming might mean. What I've read has not been terribly interesting, but here is one I read anyway:

"On testable object-oriented programming" Y Wang, et al ACM SIGSOFT Software Engineering Notes, July 1997