Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: random debugging, What should I prepare for a PL PhD program Date: Sun, 23 Oct 2022 00:00:54 -0700 (PDT) Organization: Compilers Central Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-10-052@comp.compilers> References: <22-10-029@comp.compilers> <22-10-031@comp.compilers> <22-10-035@comp.compilers> <22-10-036@comp.compilers> <22-10-039@comp.compilers> <22-10-040@comp.compilers> <22-10-042@comp.compilers> <22-10-049@comp.compilers> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="83671"; mail-complaints-to="abuse@iecc.com" Keywords: debug, comment Posted-Date: 23 Oct 2022 12:29:39 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-10-049@comp.compilers> Xref: csiph.com comp.compilers:3222 On Saturday, October 22, 2022 at 7:51:45 PM UTC-7, Hans-Peter Diettrich wrote: (snip) > Isn't it good practice to maintain a test suite at least for compilers, > that contains both selected valid and invalid code snippets? > For error reports on obviously weird input I'd prepare an equally weird > answer ;-) The only one I know that actually, really, did that was TeX. There is a test program that is supposed to execute all code except for fatal errors. To do that, you need some type of flow analysis to figure out which parts of the program are, and especially are not, being executed. The figure out what to add to the input to execute those that aren't. I don't think I am quite as good now, but in my early programming days, I had a tendency to try out features just to try them out, and often enough find bugs that no-one thought about before. The only one I can remember now is using ++ in C on a double variable. There is no rule against using it on floating point types, but it seems that compiler writers aren't so good at testing it. [There are certainly code coverage tools that are supposed to let you exercise all of the code in a program. Again, not just compilers. -John]