Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I call code that tests other code "test code," but until today I never had thought about what I should call the code I'm testing. Calling it "real code" doesn't make sense.

What do you call non-test code, whether or not it is "covered" (as in "test coverage") by tests?

share|improve this question
2  
If your test code is the "tester", call the "real" code the "testee". Err... that sounds bad... – FrustratedWithFormsDesigner May 10 '11 at 20:14
7  
Well, I call code that is not covered by tests "a disaster waiting to happen", but that isn't a full answer to your question. – Rein Henrichs May 10 '11 at 20:34
Alright, the people have spoken. Steven A. Lowe gets it. Although, I do like S.Lott's answer too. – awmckinley May 11 '11 at 1:34
@Rein Brittle code without tests === legacy code – Gary Rowe May 11 '11 at 8:10
@Gary All code is legacy code the moment it's checked in. – Rein Henrichs May 11 '11 at 18:05

9 Answers

up vote 18 down vote accepted

The Code

aka "production code", aka "the system"

share|improve this answer

Production code

This is the name commonly given to code that is the final deliverable. Hence the epithet "production quality" given to code that is ready for release into the production, or live, environment.

Often test code has it's own source tree, separate from the production code so that the two are isolated. When referring to that which is currently being tested, say by a unit test, then it is often the "class under test" or "code under test".

share|improve this answer
1  
You can then use "experimental code" or "spike code" for experiments that don't make it into the production code. – Randy Coulman May 10 '11 at 22:05

You have at least three common kinds of code.

  • Scaffolding or Support code that's used to build or test or whatever, but isn't "Deliverable"

  • Test code that may be deliverable.

  • Application code that is deliverable and is the point of the exercise.

share|improve this answer

'Application code' is what I generally call it.

share|improve this answer

System under test (SUT)

http://en.wikipedia.org/wiki/System_under_test

share|improve this answer
2  
That sounds strange to me to call the code the "system under test" but maybe "code under test" would work? – awmckinley May 10 '11 at 20:20
Actually, your answer made me realize that my question wasn't quite clear enough. I edited my question to clarify that I'm asking what you would call non-test code, whether it is tested or not. – awmckinley May 10 '11 at 20:30
1  
@awmckinley: You'd still call it code under test. Just because your test coverage is incomplete doesn't mean it gets a new name. – S.Lott May 10 '11 at 20:36
Nay, I disagree. In my terminology, the term "System under test" is used from within the context of a specific test. So therefore it would not cover the whole system code, only the piece of code being tested in a specific context. It is a term used on a different level of abstraction. You wouldn't look the entire production code base and refer it to the "System under test". Also you could write tests for test code. In this case that test code in itself would be a SUT, but it is not part of the system. – Pete May 24 '12 at 19:23

Call it "code to test" or "code being tested". Why is it even important to give it a snazzy name?

share|improve this answer
2  
The reason it's important is because I want to be able to communicate clearly with other developers. I'm still very young in my career, so I'm hoping to learn as much as I can from other developers with more experience. – awmckinley May 10 '11 at 20:43

I think most people just call it "code" and call the tests "tests".

share|improve this answer

I don't think you need a separate one-word term. When you need to clearly make a distinction, you can do it as you just did: "non-test code" clearly refers to any code that's not "test code".

share|improve this answer

"Live code" would be another term I've seen as generally it is viewed as being in production and used so that it isn't still being cooked up in the lab by this point.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.