From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4CED47EE4B for ; Sun, 29 Sep 2013 18:19:30 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of monnier.florent@gmail.com) identity=pra; client-ip=74.125.82.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of monnier.florent@gmail.com designates 74.125.82.49 as permitted sender) identity=mailfrom; client-ip=74.125.82.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="monnier.florent@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wg0-f49.google.com) identity=helo; client-ip=74.125.82.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="monnier.florent@gmail.com"; x-sender="postmaster@mail-wg0-f49.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnoBAMJSSFJKfVIxm2dsb2JhbABZDoQDgmO+E4EYCBYOAQEBAQEGCwsJFCiCJQEBBUABGx0BAwwGBQsNLiIBEQEFARwGiAYBAw+dO4xSgwqDaQoZJw1kiQABBQyPRQeEIgOXf5APGCmEDkE6 X-IPAS-Result: AnoBAMJSSFJKfVIxm2dsb2JhbABZDoQDgmO+E4EYCBYOAQEBAQEGCwsJFCiCJQEBBUABGx0BAwwGBQsNLiIBEQEFARwGiAYBAw+dO4xSgwqDaQoZJw1kiQABBQyPRQeEIgOXf5APGCmEDkE6 X-IronPort-AV: E=Sophos;i="4.90,1005,1371074400"; d="scan'208";a="28464946" Received: from mail-wg0-f49.google.com ([74.125.82.49]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Sep 2013 18:19:29 +0200 Received: by mail-wg0-f49.google.com with SMTP id l18so4503658wgh.4 for ; Sun, 29 Sep 2013 09:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=l1hNKqeloT83gPmguG1blvyxS/qkpWapCOiN2cCaLyA=; b=tOeX8Fg4XNIeW3ASjgPMiywn+H9wrlMM5FjUNlH7giqXolMKx4fpCv2fP0aDs71m9/ zNBgB5LIi0Htkg40byMgjv8Q4VsNWgucYNNJZJuEL8H7K0zvKF9Co+CNfiYcJ6UVnJJl SpR5PFEigoZJU1NlTavM172duNMU9OygJ1G0maqfAPfVyIQ85Znf5ST1TfQtVM9ok2Yf aEWpnrZCPgM3JllQrvuwh9JBjC4oJGb1e1vplktyGRQfT2NE4ea34+W209wKVb/TeyPV Ai0ODkQtl8w4wdVX5mIcuA+Nt6PG2Wo2EF6uKJhS3wjMLxa7baOewdK2Fh/9QLQATMWY VRmA== MIME-Version: 1.0 X-Received: by 10.180.76.205 with SMTP id m13mr10463650wiw.10.1380471569181; Sun, 29 Sep 2013 09:19:29 -0700 (PDT) Received: by 10.194.16.5 with HTTP; Sun, 29 Sep 2013 09:19:29 -0700 (PDT) In-Reply-To: <20130929165650.34da2e99@oberon> References: <37811b09.6ff.141695f3e3c.Coremail.syshen@nudt.edu.cn> <20130929165650.34da2e99@oberon> Date: Sun, 29 Sep 2013 18:19:29 +0200 Message-ID: From: Florent Monnier To: =?UTF-8?B?5rKI6IOc5a6H?= Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Validation-by: monnier.florent@gmail.com Subject: Re: [Caml-list] equivalent checking of ocaml program? 2013/09/29, Robert Jakob wrote: > Well, the typical approach is to write a test suite before refactoring > and ensure that the test suite runs without errors before and after the > refactoring. > > To be sure that the program really behaves like before, you need to > have a good (whatever this means) test suite. It may also be recommanded to keep the simple code next to the optimised one. It can be useful for many reasons. For example for the tests (compare them), you can also use it as a failsafe alternative if the optimised version fails. For the people who will try to read and understand your code in the future (one of them might be you). -- bp.