<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Five Testers From VC : C++ Compiler Testing</title><link>http://blogs.msdn.com/fivetestersfromvc/archive/tags/C_2B002B00_+Compiler+Testing/default.aspx</link><description>Tags: C++ Compiler Testing</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Testing the C++ Compiler – a Three-Pronged Approach</title><link>http://blogs.msdn.com/fivetestersfromvc/archive/2004/02/10/70438.aspx</link><pubDate>Tue, 10 Feb 2004 08:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:70438</guid><dc:creator>FiveTestersFromVc</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/fivetestersfromvc/comments/70438.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fivetestersfromvc/commentrss.aspx?PostID=70438</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;&lt;EM&gt;[Ron]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;Moving on from my &lt;A href="http://blogs.msdn.com/fivetestersfromvc/archive/2004/01/31/65433.aspx"&gt;previous post&lt;/A&gt;, I&amp;#8217;d like to start talking about how we approach testing the C++ compiler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;#8217;ll outline the three main approaches we use and in the next three posts I&amp;#8217;ll drill down into each one in detail.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A disclaimer: the compiler is tested by three teams inside the VC testing group; the front-end team, the C runtime (CRT) team (a lot of the functionality that the compiler relies on is implemented in the CRT), and the back-end team.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since I am a member of the back-end team, that perspective will be prevalent here.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Correctness Tests&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The first way that we test the compiler is with what we call &amp;#8220;correctness tests.&amp;#8221;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are tests that exercise the compiler by giving it code to build and, in most cases, exercise the generated code and verify expected behavior.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Cases where we would not build would include diagnostic tests.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are tests that give the compiler code that should not compile and verify that the correct error message is generated.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;Our correctness tests are arranged into a number of suites.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some are implemented by us and some are implemented by 3&lt;SUP&gt;rd&lt;/SUP&gt; parties.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;An example of test suites implemented by 3&lt;SUP&gt;rd&lt;/SUP&gt; parties that we use would be some of the commercial 3&lt;SUP&gt;rd&lt;/SUP&gt; party C++ conformance suites.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Our correctness tests are implemented using a test harness written in Perl.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The harness is pretty minimal but very flexible.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It has served us well for many years now.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For comparison, the IDE team is on their third test framework since I joined the team.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The compiler team is still using the same framework they were using when I joined the team.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is a benefit to simplicity.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Real-World Code&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The second way we test the compiler is with what we call &amp;#8220;real-world code.&amp;#8221;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What that means is that we use our tools to build large code bases.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is in contrast to our correctness tests which are usually very small, focused tests.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For this form of testing we build some of the larger code bases in the company.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Real world code building has two big benefits: 1) we exercise our tools in large, real-world scenarios that are just not possible with our correctness tests, and 2) we demonstrate to ourselves and our internal customers that we can handle their code bases with our new tools.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This helps convince those customers to adopt our newer toolsets which is a benefit to both them and us.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Benchmarks&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The third approach that we use to test the compiler is benchmarks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These are scenarios that are used to measure the performance of generated code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;In my next post, I&amp;#8217;ll drill down into the details of our correctness tests.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In the mean time, feel free to comment on this post and ask any questions you may have related to testing the C++ compiler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;#8217;ll do my best to answer them.&amp;nbsp; Thanks for reading!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=70438" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fivetestersfromvc/archive/tags/C_2B002B00_+Compiler+Testing/default.aspx">C++ Compiler Testing</category></item><item><title>Testing the C++ Compiler - Introduction</title><link>http://blogs.msdn.com/fivetestersfromvc/archive/2004/01/31/65433.aspx</link><pubDate>Sat, 31 Jan 2004 08:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:65433</guid><dc:creator>FiveTestersFromVc</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/fivetestersfromvc/comments/65433.aspx</comments><wfw:commentRss>http://blogs.msdn.com/fivetestersfromvc/commentrss.aspx?PostID=65433</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;&lt;EM&gt;[Ron]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;Inspired by &lt;A href="http://www.jixal.com/blog/archives/000085.html"&gt;Gus&amp;#8217; recent post on testing the C# compiler&lt;/A&gt;, I thought I&amp;#8217;d talk a little bit about how we test the C++ compiler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Before I do that, though, I should talk about the organization of the VC test team to put things in context.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I&amp;#8217;ll do that in this post and focus on the compiler in future posts.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The VC test team (VCQA) is organized into three sub teams: IDE/Box, Programming Model, and Code Generation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The IDE/Box QA team is responsible for the parts of VC that live in the IDE such as the VC project system, C++ intellisense, and the C++ wizards and designers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The &amp;#8220;Box&amp;#8221; part of this group is responsible for the QA parts of release management and other things such as setup, samples, and international aspects of the product.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In general, box areas are areas of the product that don&amp;#8217;t have developers on the VC team.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Most of us FiveTestersFromVC are on the IDE/Box team.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The Programming Model QA team is responsible for the Visual C++ libraries (CRT, MFC, ATL) and the compiler front end.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://blogs.msdn.com/arich"&gt;Andy&lt;/A&gt; is on this team.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;The Code Generation QA team is responsible for the compiler back-end, the 64-bit .NET JIT compilers,&amp;nbsp;and some of the tools (primarily the Linker).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Code Generation QA team is subdivided into 4 smaller teams: x86 back-end, IA64 back-end, AMD64 back-end, and 64-bit JIT compilers (the x86 JIT compiler lives on the CLR team).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I am the test lead for the x86 back-end team.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Verdana size=2&gt;Next time I&amp;#8217;ll start focusing on how we test the C++ compiler.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=65433" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/fivetestersfromvc/archive/tags/C_2B002B00_+Compiler+Testing/default.aspx">C++ Compiler Testing</category></item></channel></rss>