The Artima Developer Community
Sponsored Link

Weblogs Forum
Reviewable, Runnable Specifications Ensure Software Quality

51 replies on 4 pages. Most recent reply: Jul 11, 2010 5:16 PM by Andy Dent

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 51 replies on 4 pages [ « | 1 2 3 4 ]
Fred Finkelstein

Posts: 48
Nickname: marsilya
Registered: Jun, 2008

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jun 15, 2010 11:03 AM
Reply to this message Reply
Advertisement
>> As Eric (I think) noted, tests can't prove the code
>> correct, they can only prove it wrong. It's much like the
>> modern philosophy of science. You have a theory that you
>> test, the more tests that don't prove the theory wrong,
>> the more faith you have in the theory but it is never
>> proven to be correct.

True, but this is the wrong question! We - as computer scientist - are used to think in categories like true-false, 0-1, black-white.. but the point is testing is about confidence. If you have 100 good test cases than you have greater confidence in your programm than if you only have 10 random ones. But does it matter? James Watson will say: Well you can have a greater confidence but if your program crashes than your program crashes! True, but if you have greater confidence than one can expect that in most cases the program will work. Probably not 100%. But again: To expect that it will work in 90% of the cases is still better than to expect that it will work only in 50% of the cases.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jun 15, 2010 1:20 PM
Reply to this message Reply
> >> As Eric (I think) noted, tests can't prove the code
> >> correct, they can only prove it wrong. It's much like
> the
> >> modern philosophy of science. You have a theory that
> you
> >> test, the more tests that don't prove the theory wrong,
>
> >> the more faith you have in the theory but it is never
> >> proven to be correct.
>
> True, but this is the wrong question! We - as computer
> scientist - are used to think in categories like
> true-false, 0-1, black-white.. but the point is testing is
> about confidence. If you have 100 good test cases than you
> have greater confidence in your programm than if you only
> have 10 random ones.

Isn't this exactly what I said?

> But does it matter? James Watson will
> say: Well you can have a greater confidence but if your
> program crashes than your program crashes! True, but if
> you have greater confidence than one can expect that in
> most cases the program will work. Probably not 100%. But
> again: To expect that it will work in 90% of the cases is
> still better than to expect that it will work only in 50%
> of the cases.

First, I'd be interested to understand how you would come up with a 50% or 90% estimate. What would you base it on?

There is no way to verify that an application will work in 100% of cases for the reasons we've discussed. But the answer is not to pretend that it is possible and claim that your unit tests give you that guarantee.

Eric Gillespie

Posts: 13
Nickname: viking
Registered: Jun, 2005

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jun 15, 2010 6:20 PM
Reply to this message Reply
> > (rant)
> > I am extremely fed up with people using "real world"
> names
> > for projects especially when there's already heavy use
> of
> > a name. Sphinx is a very annoying name for something to
> do
> > with code, try Googling it.
>
> Or Python, Java, Go, C, ...
>
> C is definitely the worst of it all.

Or try searching for the "THE" editor...

Fred Finkelstein

Posts: 48
Nickname: marsilya
Registered: Jun, 2008

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jun 16, 2010 12:07 AM
Reply to this message Reply
>> First, I'd be interested to understand how you would come up with a 50% or 90% estimate. What would you base it on?

Good question, it is an estimate. The base for it could be:
- evaluation of an expert (see my example about prime numbers and mathematician)
- literature
- own experience
- .. ?

For example you could have finished a project before which is comparable to the current one. Then you could compare the test cases and the outcome and try to make an extrapolation.


>> There is no way to verify that an application will
>> work in 100% of cases for the reasons we've discussed.
>> But the answer is not to pretend that it is possible and
>> claim that your unit tests give you that guarantee.

True. But as I already said this is not the goal as it is not possible to achieve. To be as bug-free as possible or to be bug-free enough are the goals you want to achieve as a software engineer.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jun 16, 2010 6:49 AM
Reply to this message Reply
> True. But as I already said this is not the goal as it is
> not possible to achieve. To be as bug-free as possible or
> to be bug-free enough are the goals you want to achieve as
> a software engineer.

What I think you are missing is that some people think it is possible using unit tests.

Antonio Cavallo

Posts: 10
Nickname: cavallo71
Registered: Mar, 2006

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jul 11, 2010 1:39 PM
Reply to this message Reply
I like the idea of coding a requirement into a formal way: it makes sense.
Nevertheless I think the idea of doing this in just another language (as rspec looks like to me) is not that appealing because it moves the problem one step away from code to be tested.
An in general I'm not big fan of domain specific languages because we've got already too many languages around to choose from: adding another one is just add more complexity around.

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: Reviewable, Runnable Specifications Ensure Software Quality Posted: Jul 11, 2010 5:16 PM
Reply to this message Reply
Using a different language for requirement vs implementation avoids copy and paste.

It forces someone to think whilst translating and expanding the requirement.

I think that's safer than something which is close to compilable code and thus it is easier to skip adding important details.

Flat View: This topic has 51 replies on 4 pages [ « | 1  2  3  4 ]
Topic: Adding Optional Static Typing to Python Previous Topic   Next Topic Topic: Article-Recommendation Service?

Sponsored Links



Google
  Web Artima.com   

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