I think it would be an interesting project to make a language that refuses to run any code that isn't justified by tests. This would basically enforce test-driven development. What I'm thinking of is something like Jester, but built into the compiler (or interpreter).
For example, take this simple function:
(define (add x y) (+ x y))
This would cause an error saying that since there are no tests, the body of the function could be absolutely anything and nobody would be able to tell the difference. So we have to add a test:
(expect-equal 0 (add 0 0))
This would still cause an error message, because the same test would also accept a similar function that used * instead of +. In other words, the use of + isn't adequately justified. So we improve our test somewhat:
(expect-equal 0 (add -2 2))
And finally the code is accepted.
It would be interesting to see how far you could get in such a language. I would probably go about implementing it as a DrScheme language level -- it would be comparatively easy to implement, and it would fit in with the pedalogical tendencies of the PLT scheme community.
Posted on July 15, 2006 01:56 PM
More languages articles
Interesting, but I'm not clear on how the "adequately justified" part would work. Wouldn't the second test accept this function?
(define (foo x y) (+ 4 (* x y)))
And thus not be "adequately justified"? You would have to try all possible arguments to make sure that no other function would fit the tests.
Posted by: Ian at July 15, 2006 09:16 PMIt would probably go over as well as Ada did.
Ian, the idea is to do something like what Jester does -- it has a library of mutations to apply to code, and if you survive all those mutations, then the code is "good enough". Examples include negating the test of an if statement or while statement, changing a zero to a one, and a few others. I just made up the idea of replacing + with * because it kept the example simple. I would also expect the language to allow programmers to define their own mutations for functions they've written.
Sean, the point isn't to make a commercially successful language. Commercially successful languages are rarely interesting. If such a project became as successful as Ada, I would count it as successful beyond my wildest dreams.
Posted by: Kim at July 16, 2006 08:32 AMHm. You know in Smalltalk debuggers there's a button you can press to create a nonexistent method that you had tried to call. How about a programming environment where that's the only way to create a function? It'd be less strict about forcing you to test, but feel less like a nanny making you jump through hoops, perhaps. Could this be generalized so you could only introduce IF statements, etc., by supplying examples?
I haven't used Epigram, but this reminds me of how its environment is said to expand code-in-progress based on types.
Posted by: Darius Bacon at July 17, 2006 11:33 AMDarius: That Smalltalk feature is quite a bit like the Eclipse "Quick Fix" feature. It allows one to write code that doesn't compile (eg, by referencing a method that doesn't exist) and then hit C-1 to fix the issue by adding a method with an empty body. This style of development is how I write most of my code these days.
Regarding a compiler that proves that code is tested, it seems like the analysis has to be dynamic, which means it could get very expensive. I wonder what static analysis you would add to it to make it efficient (ie, detecting what tests can't possibly test a block of code and not bothering to run them).
Darius, I like the idea of making examples be part of the required syntax for an if statement. Unfortunately I'm not sure it would work well for such a small piece as an if statement -- unlike functions, if statements aren't usually designed to have a small surface area.
Richard, a simple way of reducing the runtime overhead would be to syntactically tie the tests to the code. Then it would be immediately obvious which tests need to be run to validate the code, since they're right there next to it. One way to think of it is as an extension of the idea of a method signature.
Posted by: Kim at July 18, 2006 09:39 PMI'm reminded of the Guantanamo tool for Java. It deletes any code not covered by tests.
Posted by: David Bremner at July 23, 2006 02:18 PMHm.ed hardy You know in Smalltalk debuggers there's a button you can press to create a nonexistent method that you had tried to call. How about a programming environment where that's the only way to create a function? links of london It'd be less strict about forcing you to test, but feel less like a nanny making you jump through hoops, perhaps. tiffany jewelry Could this be generalized so you could only introduce IF statements, etc., by supplying examples?
Posted by: daivd at September 30, 2009 03:28 AMSupra Shoes
Mens Supra Cruizer Shoes ---Special
Men's Supra Cruizer Red Shoes
Mens Supra Cruizer Cool Shoes
Mens Supra Cruizer Shoes --Charming
Mens Supra Cruizer Pure black Shoes
Mens Supra Cruizer Shoes --Leisure
Man's Supra Cruizer Shoes
Men's Supra Muska Skytop Shoes
Men's Supra Skateboarding Shoes
Men's Supra Strapped Shoes
Men's Supra Suprano High Shoes
Women's Supra Muska Skytop Shoes
cheap ugg boots sale
uggs classic mini sale
UGG Ultra Tall Boots
Cheap Ugg Boots
UGG Classic Tall Boots
UGG Classic Cardy
UGG Classic Short Boots
There is nothing that touches these for just lazing around at home. Bar sleeping I don’t take mine off now that its getting colder, they are not quite as stiff as they were when they first arrived but still extremely comfortable. It would be nice if they had a little more arch support but other than that I’m very pleased. I am finding a nice ugg boots!
Posted by: ugg boots at November 5, 2009 02:43 AMJust wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
Mukluk boots
Good work, thanks! My sister received the Mbt Health shoes I bought her for her birthday, she adores them. I was a little worried the calf would be tight around her legs but it hasn’t been a problem. I’ll be back before Christmas.
I think I will try to recommend this post to my friends and family, cuz it’s really helpful.
Thanks for this nice post, i like it very much, write this article more.Nike Air Max 2003 Shoes
.
Only One word to characterize such a great post “WOW” that was a very interesting read
Adidas
Find Jeans ?!UGG boots On Sale ,Enjoy free shipping + bargain sale now!
UGG Classic Short,100% Authentic UGG Australia Boots!ALL of
Jeans are the cheapest and best for you!Enjoy yourself of shoping , Find Cheap Sheepskin
Jeans !
We also supply other products such as:
Hey, i am very happy today, I received my Mbt shoes
just now, very impressed. They are like sort of a massive slipper, soft, easy to wear and
light.
Posted by: Mbt shoes at November 5, 2009 02:52 AMThere is nothing that touches these for just lazing around at home. Bar sleeping I don’
t take mine off now that its getting colder, they are not quite as stiff as they were when
they first arrived but still extremely comfortable. It would be nice if they had a little
more arch support but other than that I’m very pleased. I am finding a nice
mbt shoes sale!
discount nike air yeezy
china wholesale online
discount ugg boots
nike free shoes
furture
ugg boots
Discount store
stock
lovers number
discount nike air yeezy
china wholesale online
discount ugg boots
nike free shoes
stock
lovers number
discount nike air yeezy
china wholesale online
discount ugg boots
nike free shoes
furture
ugg boots
Discount store
stock
lovers number
discount nike air yeezy
china wholesale online
discount ugg boots
nike free shoes
stock
lovers number
discount nike air yeezy
china wholesale online
discount ugg boots
furture
ugg boots
Discount store
Uggs on sale now.UGG Classic Cardy Boot makes me different form the other
girls. The UGG Bailey Button Boot is a good choice for female.
Posted by: ugg classic cardy boots at November 17, 2009 12:40 AMThe
39.html">classic cardy uggs boots is another hot boots that worth of buying.And the classic tall ugg boots
will make your winter amusing.And now uggs on sale,if you are looking for such a boot,the ugg boots is good choice this year.
www.enjoywholesale.com
china wholesale clothing,china wholesale shoes,china wholesale electronics,china wholesale suppliers,china manufacturers
china wholesale products,light in the box,wholesale lots,wholesale ipod
china direct,china dropship,china trade,made in china
electronics wholesaler,ebay wholesaler,financial wholesaler
fashion wholesaler,clothing wholesaler,wholesaler magazine
computer wholesaler,external wholesaler,dvd wholesaler,wholesaler definition,china wholesaler,mutual fund wholesaler,define wholesaler,insurance wholesaler
discount ugg boots
forture
ugg boots
Discount store
replica omega
replica oris
replica Panerai
replica Patek Philippe
replica Piaget
Supra Shoes
Supra Skytop Shoes
Supra Society
Supra Thunder
Supra Suprano Hi
Supra Strapped
Supra Trinity
Supra Skylow 1.5
Supra Dixon
Diablo 1.5
Supra Cruizer
Supra Vaider Shoes
Supra Cuban
Mbt shoes are promotion now,Mbt sport shoes and Mbt m walk hot onsale
Posted by: mbt shoes at November 19, 2009 01:46 AMMbt shoes are promotion now,Mbt sport shoes and Mbt m walk hot onsale
Posted by: mbt shoes at November 19, 2009 01:47 AMWe are the best online sales for the china wholesale . Here you can have a large of choices of kinds Ugg Boots,Converse Shoes,Timberland Boots,puma shoes,Nike Shox Shoes ,Nike Dunk SB Shoes,Nike Air Max,Links Of London,Tiffany Jewelry,Dior Handbags?,jimmy choo handbags ,Cartier Watches, 8GB Mp4 Players,Bluetooth Car DVDs. All our cheap online cheap goods are high quality and original packages, and best service. We offer our customers the best service, 7 days arrive at your door.Enjoy your easy and happy shopping with us.
Nike Men's AF1 Light-up Shoes
light up air force
light up mens shoes
air force lights-up
light up shoes mens
light up air force ones
light up air force
air force lights-up
light up shoes af1
discount nike air yeezy
china wholesale online
discount ugg boots
nike free shoes
furture
ugg boots
Discount store
lijunrong Tiffany&Co Elsa Peretti Open Teardrop Pendant Necklace - Tiffany Jewelry Online
Tiffany&Co 1837 Three-Drop Circle Pendant Necklace - Tiffany Jewelry Online
Tiffany&Co 1837 Triple Bar Pendant Necklace - Tiffany Jewelry Online
Tiffany&Co Comma Cuff Links - Tiffany Jewelry Online
!!! Title too long !!!
Tiffany&Co Heart Key Ring - Tiffany Jewelry Online
Tiffany&Co Matching Key Rings - Tiffany Jewelry Online
Tiffany&Co Paloma Picasso Double Heart Earrings - Tiffany Jewelry Online
Tiffany&Co Paloma Picasso Zig-Zag Earrings - Tiffany Jewelry Online
Tiffany&Co Woven Earrings(E032) - Tiffany Jewelry Online
Laptop Battery Laptop Battery Laptop Batteries
Laptop Batteries discount laptop battery
discount laptop battery
notebook battery notebook battery
computer battery computer battery
replacement laptop battery replacement laptop battery
notebook batteries notebook batteries
People all over the world know the abercrombie and fitch,but not everyone really knows how fashion the abercrombie is,hollister is the Legend maker. Everybody wears the hollister clothing would be the abercrombie mens and the abercrombie womens, if you want know you can search the Ruehl No.925 or abercrombie outlet in the www.google.com .
Posted by: fitch at November 25, 2009 09:45 PM$75 Replica Rolex Watches sale, Our site provides Rolex replica, replica Rolex Watches, replica breitling, replica Cartier, replica Omega, Tag Heuer Watches. . .more than 100 famous rolex brands"
rolex air king
rolex datejust
rolex day date
rolex daytona
rolex gmt
rolex submariner
rolex yachtmaster
a lange sohne watches
alain silberstein watches
bell&ross watches
breguet watches
breitling watches
bvlgari watches
cartier watches
omega watches
patek philippe watches
chaoying nfl jerseys
Giants Jerseys
Patriots Jerseys
Packers Jerseys
These things are good, I hope you can continue to maintain!
China Electronics Wholesale China
Phone Cheap Cell Phones
href="http://www.thechinaphone.com/index.php?main_page=advanced_search_result&keyword=China%20Wholesale">China Wholesale
replica handbags
Louis Vuitton Replica
Louis Vuitton handbags
fake Louis Vuitton bags
fake Louis Vuitton
replica rolex
replica rolex
fake rolex
buy cheap fake rolex
rolex Submariner
China Electronics Wholesale China
Phone Cheap Cell Phones
href="http://www.thechinaphone.com/index.php?main_page=advanced_search_result&keyword=China%20Wholesale">China Wholesale
replica handbags
Louis Vuitton Replica
Louis Vuitton handbags
fake Louis Vuitton bags
fake Louis Vuitton
replica rolex
replica rolex
fake rolex
buy cheap fake rolex
rolex Submariner
Paul Smith has been collaborating with a few different organizations recently and his latest venture sees him teaming up with Japanese bicycle saddle, Paul Smith bag, on a limited edition leather saddle. The release features Smith’s signature stripes where only 20 will be available at Paul Smith Clothing store in Japan and 8 at the Floral Street store in London. Get on it quick
Posted by: dasf at November 29, 2009 11:45 AMJust wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
ugg bailey button
Wow, my ugg classic mini will not be coming off now! I’ve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.
It is no doubt that Replica Louis Vuitton Speedy 30 enjoys highest reputation in the world. Louis Vuitton Speedy 30, purses, shoes, watches, clothes, and belts successfully seize loving heart of a majority of people. Speedy 30 is filled with romantic and fantasy, and it is a symbol of noble and high quality of life for gucci ever! Today, let us talk about Tivoli PM.belts have different styles and colors, such as Monogram series belts, Graffiti series belts, both men and women love them crazily. All of them match with various leisure clothes, formal business suits, and beautiful clothes very well. Whenever you wear a Louis Vuitton belt to make your public appearance, you will be naturally concerned and admired by every body. When we talk of high quality, there is no other company to compare with Louis Vuitton Replica Speedy 30. All Louis Vuitton belts adopt top quality cow leather, high quality hard ware, and the color will never be faded. The belts are so durable, and you can wear them to match your clothes for several years. Also, you can clearly see an obvious LV logo as a buckle of each belt.
Posted by: fanqin at December 1, 2009 02:14 AMBurberry Handbags|
Burberry Handbag|
Burberry bags|
Burberry bag|
Chloe Handbags|
Chloe Handbag|
Chloe bags|
Chloe bag|
Christian Dior Handbags|
d&g Handbags|
d&g Handbag|
d&g bags|
d&g bag|
Hermes Handbags|
Hermes Handbag|
Hermes bags|
Hermes bag|
replica Hermes|
replica Hermes Handbags|
cheap replica watches
Yachtmaster watch for sale
Bvlgari watches
movado watch for sale
replica Rolex Day Date
nike Running Shoes
cheap replica watches
oris watch for sale
Glashutte watch for sale
Cartier watch for sale
Vacheron Constantin replica
The supplier of most category of goods
Just wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
click here
auto profit launcher review
immediate list profits review
howies apprentice 5 review
ppcloophole review
list laundering review
my cash printer
ugg boots sale at a time when large heat has set off a winter 08/09 to Ewha.Outlines the
warm wool winter fashion degree to wool crocheted wool ugg boots uk to join after the
body does not stimulate your skin soft, soft comfort UP. Fashion can not without
ugg boots presence in Winter.and ugg boots have many series.such as:
ugg classic
UGG Bailey Button boots
ugg nightfall
ugg kids