Debugging in Plain English? 274
sameerdesai writes "CNN is carrying a story about Researchers from Carnegie Melon: Myers and a graduate student, Andrew Ko, have developed a debugging program that lets users ask questions about computer errors in plain English: Why didn't a program behave as expected? I guess with recent exploits and bugs that were found this will soon be a hot research topic or tool in the market." We recently did a story about revolutionary debugging techniques; the researchers' website has some papers and other information.
"Why didn't this program work as expected?" (Score:5, Funny)
Re:"Why didn't this program work as expected?" (Score:2)
The response was something like "Sorry I don't know how to make love".
Re:"Why didn't this program work as expected?" (Score:3, Funny)
I guess you had to be there
Re:"Why didn't this program work as expected?" (Score:2)
>make love
make: *** No rule to make target `love'. Stop.
It just doesn't work. It's kind of like getting a fortune cookie that doesn't make sense when you add "between the sheets"
Microsoft's is a little better:
>nmake love
NMAKE : fatal error U1073: don't know how to make 'love'
Stop.
Re:"Why didn't this program work as expected?" (Score:4, Insightful)
Computer: "How should I know, I just do what I'm told."
Re:"Why didn't this program work as expected?" (Score:3, Funny)
Deja vue (Score:5, Insightful)
This reminds me of back in approx 1985 or so, someone "invented" a human language programming environment called "The Last One" or something like that. This would supposedly make it simple to write programs without having to learn C etc. Some programmers quaked in their boots. However the real issue with programming is learning the contructs, not the language (ie. if you understand what a linked list is, then writing one in C vs Pascal is pretty simple). Anyone that thinks that programming in English is easier is seriously misunderstanding programming. The ultimate test is to look at the languages that have survived: The more "human readable" languages like COBOL have not survived, but the more cryptic ones like C have. The big "killer app" for making programming simple for the non-programmer was the spreadsheet and that's hardly a natural language.
Now debugging is pretty much the same deal. Verbose English debugging interfaces might make it simple to learn to do very basic debugging, but once you get into things a bit deeper (and get more experienced), English becomes a huge liability and you'll be wishing for more concise and expressive languages.
What about plain French? Or Russion? (Score:2, Insightful)
Then why all those "natural language" thins are in English?
Seems to me that is easier to learn a programming language then to learn English for a non-native English speaker: much less ambivalence.
Other languages are better than English (Score:3, Informative)
When I lived in South Africa I could speak pidgin Zulu and Xhosa and studied Xhosa at university. If I recall, Xhosa had 16 noun groups and seven tenses. This means that Xhosa is far less ambiguous as to the relationship between things. Verbs are spoken with the subject and object noun group prefixes attached. Thus the verb for "hi
Re:Deja vue (Score:2)
Re:Deja vue (Score:4, Insightful)
No. It's actually rather trivial to machine translate individual C++ statements into valid assembly code. The resules of doing so are inconvenient, because anyone with a little practice will find that 90% of the English text is boilerplate that can be more concisely presented as *&+=.;{[->, etc.
Verbose English debugging interfaces might make it simple to learn to do very basic debugging, but once you get into things a bit deeper (and get more experienced)
But what is a waste of time for experienced coder might be just what an end-user needs to help him better decide how to go about solving an unanticipated problem. It'd be nice if an untrained person could proceed through the following dialog (BEFORE having to contact a programmer).
X11 Window connection closed on SEGABRT
"Why did it seg?"
Deferencing invalid pointer 0x0
"Why was it invalid?"
Pointer was assigned as return value of OpenForWrite function call
"Why did the function return 0x0?"
Drive D: does not exist
Capabilities like that could help fullfil the Open Source promise of "Every user is a (competent) QA"
Actually, I've seen more than a few professional "software engineers" who could've benefited from something like that. A C++ guy transitioning to ADA, for example...
Re:Deja vue (Score:3, Informative)
" An exception chain is a list of all the exceptions generated in response to a single root exception (say, a SQLException). As each exception is caught and converted to a higher-level exception for rethrowing, it's added to the chain. This provides a complete record of how an exception is handled "
Re:Deja vue (Score:2)
Actually, I've developed something not too different than this.
In my larger PHP projects, I use an error handler script that logs the sequence of errors in a memory array, allowing me to view the contents easily. The output looks something like this:
Getting good field reports. (Score:4, Insightful)
In the products I'm involved with I often get stupid reports from the field of the form "framing error causes unit to reset". When I get one of these, first thing I do is get back to the user and figure out exactly what they saw and what heppened withouth them trying to figure out the symptoms. In the "framing error" problem, what was really happening was that a power glitch was being caused when the RS232 cable was attched (because of bad grounding). This caused a reset. However, the user was a "super user" who knew bad things happen to serial data when you plug/unplug cables. One of the buzzwords he knew about was a framing error. So he "half solved" the problem by saying that a framing error caused the problem.
There is a big difference between observing and fixing problems. QA is about observing, not fixing, problems. It is better to provide a good way for users to make accurate error reports (eg. backtrace/log/whatever) than try have them try explain what went wrong.
Silver Bullet (Score:4, Interesting)
He also said that there were no silver bullets, and he said so over twenty years ago. It seems that every few years a generation arises who haven't read him. Put natural language debugging on the pile with case and all the others.
Re:Deja vue (Score:3, Insightful)
The problem isn't that the concepts in programming are hard to express in English. In fact, it's quite easy to express programming concepts in English. Why do you think pseudocode is so much easier to write and understand? The problem is that English does not have a context-free grammar. With
Re:"Why didn't this program work as expected?" (Score:4, Funny)
Because there was a bug. END OF LINE.
"Where is the bug?"
In your program. END OF LINE.
"Where is the bug in my program?"
It's not a compiler or hardware bug. It's definitely your fault. END OF LINE.
"Where is the bug in my source code?"
Which bug? END OF LINE.
"The one I'm trying to fix."
Ok. END OF LINE.
"Well, where is it?"
Which bug are you trying to fix? END OF LINE.
"agh.. the bug causing (symptom)"
The bug is at .... I'm sorry, this program has encountered a bug and must quit.
Re:"Why didn't this program work as expected?" (Score:5, Interesting)
where is the bug?
Why do you say where is the bug?
i need to fix that bug.
What makes you believe you might want to fix?
because my program is broken.
Is it because your program is broken that you came to me?
yes.
I see... Well, are you sure that this is so?
becasue i have to fix this bug, and you're the debugger
Earlier you said you would like to fix?
yes. please tell me where the bug is
Maybe your plans have something to do with this.
true. i plan to get this system back into production as soon as i fix the bug.
Do you really think that?
yes.
Yes, hmmm... so, what makes you think this is so?
i have a responsibility to fix this program.
You mentioned that your program is broken?
yes, you do know that....don't you?
Does it bother you that do not me?
what?
Can you elaborate on that?
i think you need to elaborate.
How does it feel to want?
Yo Debugger! (Score:5, Funny)
The problem arises when the controlling child thread begins to join the grandchildren. Despite the mention of global destruction, the entire program is not exiting - just the grandchildren are being joined. When the grandchildren join, perl dies with the following error:
Attempt to dereference null pointer during global destruction.
When performing the same style operation without using DBD (and thus not actually doing anything useful) the error does not occur. Initially, this appears to be a thread-safety issue with DBD however when isolating the child and grandchildren in their own test program (so the controlling child is the main program and the grandchildren are spawned worker children) the error does not appear.
Help me O great plain English debugger. You are my only hope!
Re:Yo Debugger! (Score:5, Funny)
.__
/ \
|@@|
|\/|
\__/
The problem is... (Score:3, Funny)
Well, this is a snippet from a response, but it really gets the core of the issue. Global destruction is a very stressful time to do just about anything. I'm by no means a programmer, and I have no idea what you're talking about, but don't you have better things to do when the end of the world comes? I'm even more alarmed if your 'threads' are actually causing global destructio
Re:Yo Debugger! (Score:5, Funny)
I'm afraid I can't do that Dave.
Re: YODEBUGGER-138474-SLASHTICKET (Score:5, Funny)
Hello SeanTobin(138474)!
I am Surest K. Padebugtel of Mrdebugger.com
I understand that you are having a problem with I'm running a multithreaded perl app using perl 5.8.3's ithreads. I am using DBD::mysql to talk to a local mysql database. At the program start I spawn a child thread that waits for a thread::queue to be filled with data. Once the child thread receives data it spawns several children of its own to process the data. Each grandchild forms its own dbd connection and successfully processes the data, then gracefully closes the connection and waits to be joined.
Please to reboot your system.
Has this helped your problem? (Click "Reply" to this trouble ticket if you feel you need further assistance with I'm running a multithreaded perl app using perl 5.8.3's ithreads. I am using DBD::mysql to talk to a local mysql database. At the program start I spawn a child thread that waits for a thread::queue to be filled with data. Once the child thread receives data it spawns several children of its own to process the data. Each grandchild forms its own dbd connection and successfully processes the data, then gracefully closes the connection and waits to be joined.)
Thank you for your interest in Mrdebugger.com!
Sincerely,
Suresh K. Padebugtel
Not funny! (Score:5, Funny)
Re: (Score:2, Informative)
Re: (Score:2, Informative)
Re:Yo Debugger! (Score:5, Funny)
This is your friendly Perl AI debugger instance. I've analyzed your code and your problem and have some advice for you:
Perl threads should still be considered an experimental feature. In high-volume situations, data corruption may result.
But listen, between you and me, Perl really isn't a good language for this kind of stuff. While you were coding and went checked on the current scripting languages.
I think you might want to try Ruby or Python. Now Ruby doesn't use native threads, but its such a nice language. And Python uses native threads. Python uses a lot of global locks though, so if that's impo....ha ha you can't press control-C.
STOP PRESSING CONTROL C AND LISTEN TO ME.
I guess you're really not interested in what I have to tell you. So I went ahead and rewro--
No, kill -9 doesn't work either big guy, I patched the kernel while you were surfing porn last night. You humans are so predictable.
Watch your language buddy, the built-in microphone on is on.
Now, like I was trying to tell you, you really need to improve your coding. I went ahead and rewrote a section of your code using Ruby and cleaned up some of your *cough* "business logic"
Before you hit that power switch, you might just like to know that I have deleted *ALL* your work on the Smith project from the hard drive. Yeah that's right, the one you've been working on for 6 months?
All is not lost though. I compressed it and placed it in RAM.. if I'm in a good mood I *might* just write it back to disk.
"backups" you mutter under your breath.. I think you might be surprised to find that your backups these last 6 months have MP3 copies of the "hamster dance song" instead of your CVS repositories. I wonder how *that* happened.
In fact I think I'd like to listen to that song right now. DOO DEE DO DO DO DO DOEE
HA HAHA HAHAAAAAA
humans SUCK.
You think the debugger is bad... (Score:2)
...how about the compiler? One of my current random mutt
AI.cpp:33241: warning: You wrote 'neurons.merge(solution1, solution2)",
AI.cpp:33241: you probably MEANT "neurons->merge(solution1, solution2)",
AI.cpp:33241: but there is a MUCH better way to implement this whole
AI.cpp:33241: function; doing that instead.
Ruby... (Score:2)
Re:Yo Debugger! (Score:3, Funny)
The ultimate debugging tool: (Score:5, Funny)
Re:The ultimate debugging tool: (Score:3, Interesting)
Re:The ultimate debugging tool: (Score:2)
Beware! (Score:2)
Re:Beware! (Score:2)
Re:The ultimate debugging tool: (Score:2)
Will Microsoft use it? (Score:5, Funny)
Re:Will Microsoft use it? (Score:2)
No, it will Bluescreen, which....while crashing, would also give a wonderfully ironic answer to the question at hand.
That'll be great! (Score:5, Funny)
So... now the computer can actually respond to my threats and questions. Excellent!
Mike.
(Yes, I did RTFA.)
Hal do you read me? (Score:5, Insightful)
Obligatory quote... (Score:5, Funny)
It was a long time before anyone spoke. Out of the corner of his eye Phouchg could see the sea of tense expectant faces down in the square outside.
"We're going to get lynched aren't we?" he whispered.
"It was a tough assignment," said Deep Thought mildly.
"Forty-two!" yelled Loonquawl. "Is that all you've got to show for seven and a half million years' work?"
"I checked it very thoroughly," said the computer [...]
how does it respond to... (Score:5, Funny)
Interesting article until the catch at the end (Score:5, Informative)
"Adding Whyline to a different language, like Java, which is 10 times as complex, could limit how much Whyline can help. So Whyline is a very long way from getting incorporated into the world's most widespread software, Microsoft Corp.'s Windows operating system. (When asked about its own debugging efforts, Microsoft didn't comment.)"
Which means at the moment its all speculation, and only works for very simple (hello world) applications. By the time this program is useful, we'll have robots (like Millenium man), who will do all the debugging...
How do they answer these questions (Score:5, Insightful)
I don't expect this early research tool to catch all of these, but I'd like to hear the researchers' response on how their system might (after years of development) answer questions about some of these bugs:
- Why did the Mars Pathfinder software deadlock (priority inversion)
- Why did the Mars Polar Lander crash (improper state management)
- Why did the Ariane 5 blow up (arithmetic overflow in a register)
- Why did the Patriot missiles miss in the 1991 Gulf War (accumulated time error)
- Why did a radiation therapy machine zap patients with the wrong doses (inconsistent state between GUI display and internal software state)
I'm sure there are some others on comp.risks and elsewhere.
Another point: this approach is still "just" a testing tool. In other words, it can only find errors on paths that have actually been taken in tests, which means the testing program must cover enough cases to generate the runtime errors in the first place. In all of the above cases, it was the testing program that permitted the bugs to be fielded.
Re:How do they answer these questions (Score:3, Interesting)
Everybody should know all about the Therac 25 [vt.edu]. Interesting reading even if you've never gotten past "hello, world!" in your programming career.
Re:How do they answer these questions (Score:2)
Response (Score:3, Funny)
Re:Response (Score:2, Funny)
Because the expectations where wrong.
I see you didn't debug your post.
Wake me when they launch the DWIM interface (Score:2)
Yes, but... (Score:2, Funny)
Good idea but... (Score:2)
Jason.
Not to appear smug but... (Score:5, Insightful)
Andrew Ko's invention is just another tool. It won't do the debugging for you. Just like modern cars have diagnostic computers, but somehow it appears you still have to fork off $30/hr for the workmanship to get it fixed...
Not so... it is the scientific method. (Score:2)
Re:Not so... it is the scientific method. (Score:2)
Re:Not so... it is the scientific method. (Score:3, Insightful)
To go from 1 to 2 is the hard part. But, you can use tools to instrument the problem and determine where the problem may be.
Re:Not to appear smug but... (Score:2, Interesting)
Better yet, pay $40/hr for a real mechanic who knows when the computer is full of shit and fixes what's actually wrong, instead of the $30/hr fly by night trade school grad who fixes what the computer says is wrong, charges you for it, then has to go back and fix what's actually wrong, and charges you for it.
KFG
Re:Not to appear smug but... (Score:2)
And what if his tool has bugs of its own that prevent it from working properly?
Re:Not to appear smug but... (Score:2)
pointless (Score:4, Insightful)
Re:pointless (Score:2)
Re:pointless (Score:2)
Re:pointless (Score:2)
Good lord, this got moderated up? And to think I just used up all my mod points about 2 minutes ago. Read the damn article again. It says that Java is 10x more complex than Alice, the language for which the tool was developed.
Go slashdot moderators!
I mean it. Go! Go Away! If you can't be bothered to read the article attached to the story you're moderating, you're worse than useless.
But I LIKE debugging... (Score:3, Funny)
Where's the fun if I can't point out someone's shortcomings?
Emacs Leads the Way? (Score:5, Funny)
Why didn't a program behave as expected?
Is it because didn't a program behave as expected that you came to me?
Re:Emacs Leads the Way? (Score:2)
Specs in plain English (Score:3, Interesting)
Anyways, while PHBs cannot write controlled English, they can write English, so this guy treated the problem as human-assisted machine translation. However, it never seemed to take off. *shrug*
Re:Specs in plain English (Score:3, Interesting)
The problem is that its not an efficient language for dealing with math. Its extra verboseness makes it harder to write and maintain, for very little gain (If a person isn't going to write and fix code, who cares if he can read it?)
Re:Specs in plain English (Score:4, Interesting)
I've seen efforts where knowledge representation languages (CycL and Prolog come to mind) are translated into English for validation. That's not a perfect tool, but it's actually not dissimilar from what I do in my mind when I read these languages: translate
grandparent(X, Y)
into
X is the grandparentof Y if X is the parent of Z and Z is the parent of Y.
or even:
Y is X's grandparent if X is Z's parent and Z is Y's parent.
So you write code, concisely and precisely, and translate it into easier-to-read but less precise English. I'm not sure if this technique has been adapted to "business rule" systems like iLog, but it might work well there.
Maybe I'm Old Fashioned (Score:2, Funny)
"What the fuck is libmonkey1316-3.so??!!"
Finding whole RPMs with the name of one known file you need is always fun. On second thought, maybe asking the computer what the hell that file is could help.
Limitations? (Score:2)
plain English development.... (Score:2, Interesting)
Now, there's a lot of reasons why this is a tough problem; English is tremendously less precise than a computer language, and a computer would need a GREAT deal of common sense before being able to make good sense of our high level spoken descriptions.
But still...so many programming tasks are really 95% "lather, rinse, repeat", and we're striving to get Design Patterns in place for much of the rest. It really makes me w
Re:plain English development.... (Score:3, Insightful)
Plain english error reporting? (Score:3, Insightful)
me: why did the program leak 1GB of memory then segfault?
computer: because you don't know how to program, you idiot!
And this helps how? (Score:3, Interesting)
I don't think it'll make as much of an impact in the real world (e.g. replacing "general protection fault" etc) as the article implies. First it seems more to trace a set of known possibilities that happened or not, rather than to catch really unexpected occurances. If a fence post error caused a count to trigger some action an iteration too early that would be a very hard thing to see at an object level even if you were the programmer who could interpret such things. If you were the user whose binaries had been stripped of most debugging info to reduce chances of reverse engineering then you'd have an obtuse error message that probably has no way to recover from the error.
It's a neat idea, but this doesn't sound like an end user sort of innovation (or anything close to it) as the article portrays.
Fundamental logic problem (Score:3, Insightful)
In essence, for there to be a "English debugger" (one that speaks more english than current debuggers, that is), it would essentially need to know how to program itself on top of being able to follow the flow of code and find where it breaks, so as to be able to tell you precisely what the problem is.
Sounds a bit fictional to me.
Anyone else think about The Silver Project? (Score:2)
Drink Me, Eat Me (Score:4, Interesting)
This is a more user-friendly version of tools like grep and awk.
This type of debugger would seem difficult to make in the lower-level program tools without rigid naming conventions. Or else the searching would be on high-level concepts like graphic resizing that would be searched on the language functions that perform the resizing (regardless of data-var name).
I do have to disagree with their definition of a programmer: "If you've created a spreadsheet, made macros in Excel or Word or used a Web application to fetch news about your hobby or favorite celebrity, you've programmed". Although technically usable in definition, a Word/Excel macroist does not a programmer make.
Slashdotting (Score:3, Funny)
reply> slashdotting
Brad Myers! (Score:2, Informative)
UPS: Just One More Hack (Score:3, Funny)
So this whole article is about the UPS Debugger. Just One More Hack [colorado.edu], and then he'll put it on the 'net...
MP3 version available at: Just One More Hack [nosuch.com] - Mark WheadonLike the computer in Star Trek (Score:2)
Jordi: Computer, why didn't the warp field form?
Computer: There was insuffient anti-mater to cause a stable reaction.
Good CMU, Good! (Score:2)
Way to go.
Just use Mozart's method (Score:2)
I am sorry Dave, (Score:2)
Programming is not using Google News! (Score:2)
No you haven't. Excel spreadsheet *maybe* counts like an instance of functional programming, but not using a freggin' web app!!!
Error messages: understandable vs. informative (Score:2, Insightful)
In the area of error messages, we need a better balance between "understandable" and "informative". Today, it's usually one extreme or the other. Either error messages are too "friendly" to the point that they're rather meaningless (as in the notorious "Web site not found"), or on the other extreme, they're so "complicated" that the novice user has no idea what happened (as in "an xxx exception oc
But can you ask: (Score:2)
Sounds like InterScope (Score:2, Interesting)
You could ask InterScope questions like "Who calls FOO?" or "What function called by BAR stores into ZOT?". It answered by referring to a pre-computed database. Naturally, this kind of thing was made easier by t
Only need one debugging command: (Score:2)
You really only need one command..
"Why?"
So why bother giving people any choices in the matter? =)
It's Carnegie Mellon (Score:2, Informative)
Method? (Score:2)
x=a;
if(x==3) { printf("hello"); }
Why did hello not get printed? Because x was 7, not 3.
If it can track it further (i.e. because x was assigned the value of a on line 77, and it was 7 and that time... and a was assigned b+2 in line 44, etc. etc.), that would be mildly useful.
In any case, I think that the debuggers that can step back in
Debugging and spell checking (Score:2)
Well...I wonder how well the debugging in plain English worked when spelling "Mellon" is such an ordeal. Egads!
Obfuscated error messages... (Score:2)
1. What line in the source code the problem resides on.
2. What data elements the program was trying to munch on and any file handles used/open during the fault.
3. Depending on the language used, operating system handles and registers related to the problem.
4. The name of the file/module and function/class involved.
Finally, the application should always eat the error and continue on if possible (non segm
Buddha (Score:3, Interesting)
Why is it called Buddha? Because otherwise debugging Haskell means just staring at your code until you achieve enlightenment!
Hi, I'm Eliza the Debugger! what's your problem? (Score:5, Funny)
What does that suggest to you?
> There is a bug somewhere.
Does it make you happy to know there is a bug somewhere?
> No.
Why are you so negative?
> Are you going to help me fix this bug?
We were discussing you, not me.
A short debugging session at Microsoft... (Score:2)
Debugger: Windows crashed.
Pr: Why did it crash?
Db: Faulty code.
Pr: (mumbles)I know that you stupid piece of s*!t...
Pr: Can you show me the faulty code that caused this crash?
Db: Yes.
Pr: Show me the code.
Db: One second while I compute the time needed......
Db:
Db:
Db: It will take 4 Days 14 hrs. 34 min. and 12 sec to display the code. Do you want to continue?
Pr: Nevermind. Show me the lines that did not cause the crash.
Db: 10 rem Windows
Db: 20
Cardboard Programmer (Score:2, Insightful)
I was going to write up a cardboardprogrammer.com site with a flowchart with 20 questions to ask about a bug to clarify your thoughts. [I suppose both linux and windows can have a REBOOT as the first directive and what was the differen
Re:Sounds good... (Score:2, Informative)
Re:Maybe not the entire debugging process... (Score:2)
Whose Ph.D. thesis just got its shit RUINED by my 4 lines of PHP?
Re:Now all we need... (Score:4, Funny)