From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 0CF6B7F1AA for ; Thu, 10 Sep 2015 01:18:22 +0200 (CEST) IronPort-PHdr: 9a23:gJA7JRBrWbQkQA1o9mV7UyQJP3N1i/DPJgcQr6AfoPdwSP7zrsbcNUDSrc9gkEXOFd2CrakU16yP7uu5CCQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTrkbnvsMSCKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ6jiR6WbwyP4DM3Un8XiQZPGwjI9lnfVb71qir8u6Ip2iyRNMnuTLYcXzG+qapnVUm7pj0AMmsW/Xvbwvdsi6ZDpRunoVQrwojaZ6maOeByO7jBetcCQGNHWIBdWnoSUcuHc4ITAr9Zbq5jpI7nqg5L9EPmCA== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=info@gerd-stolpmann.de; spf=None smtp.mailfrom=info@gerd-stolpmann.de; spf=None smtp.helo=postmaster@mout.kundenserver.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BWAQDAvfBVlIJ+49RdDoNpaYMksGaLHAaFfQKBPjsRAQEBAQEBAQEQAQEBAQcLCwkfMIIdggcBAQQjMhcKAxALQgICVwYTCYgpCbZ2lAkBAQEBAQUBAQEBAR2FeIV2hGYmB4IuDC8SgTEFhy4DhUaBLocxdwKUeQORfYNoQG8BiEgBAQE X-IPAS-Result: A0BWAQDAvfBVlIJ+49RdDoNpaYMksGaLHAaFfQKBPjsRAQEBAQEBAQEQAQEBAQcLCwkfMIIdggcBAQQjMhcKAxALQgICVwYTCYgpCbZ2lAkBAQEBAQUBAQEBAR2FeIV2hGYmB4IuDC8SgTEFhy4DhUaBLocxdwKUeQORfYNoQG8BiEgBAQE X-IronPort-AV: E=Sophos;i="5.17,500,1437429600"; d="asc'?scan'208";a="176757734" Received: from mout.kundenserver.de ([212.227.126.130]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Sep 2015 01:18:21 +0200 Received: from office1.lan.sumadev.de ([88.69.138.237]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MY20C-1Z52Ds3qBE-00Updo; Thu, 10 Sep 2015 01:18:21 +0200 Received: from [192.168.65.22] (office6.fritz.box [192.168.65.22]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 2B4B9DC05D; Thu, 10 Sep 2015 01:18:19 +0200 (CEST) Message-ID: <1441840691.9319.37.camel@zotac> From: Gerd Stolpmann To: John Christopher McAlpine Cc: Ocaml Mailing List Date: Thu, 10 Sep 2015 01:18:11 +0200 In-Reply-To: <55F09806.1030507@nmt.edu> References: <55F09806.1030507@nmt.edu> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-xP7rpZ0f3/o/MLx6JhTX" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:ItMtV50P6scQO1FLYYcGERM4WSgvyjIp75sXfYBoPKbkCyLTGIH tc1/XtqtOW697kz9yIQS7SOhRyHzbwCnWe78P9xbQiab9d8Ijz2ZSdnBi2l/qpZeYCHy/K8 CSj3n9kfJN3fwYM0anLcp4vhQerZ2pd/Cn1ptKWD1Muej/6OhD3NHdXV6rfh2GDk4b8PcXk kDYokkGKbTxTMnfh0ZhRQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:10tbinPU4bQ=:ZSX4+3bXocNqV/zM66Djj6 bYM4ihi+o2iZiNm79o8GVkzg5m9EIzCd4u2Aol181bGtq4E7LEv58jmt2pDNItBl8UdRDhALb Hz4apARKaq7TTZDPqPLsx4vAxq11gAY6p5qrA99wkMBoWLcuZtLZRIbTiFLWhijFYnGqqUdai SrrjCQ4H62CulkZVGpJLOyd201aVCT+y+Ynp6AMSkqi5qFKoasYz1e7XkN3mNKnWG3c+9qLFw PsPMotE1zKe3nLwi+C+Kvu6wNeMuf66dOu+vQ9PRA/pSypDZ6wifYgS1BB4ZhP3A8ktlKJKGd jU6pjdmkuk5Q3ZqgbY9jCfNbWQuc7Av/adjZOWrCIjURMX+3xZkAsBwyrkPDjT4sglZyLjH6t b65TeFFed+xxI+Qy8Upt2Q1H7VTze+t0ikam6q0htW16lN1J/Q11e/MUBLedNZ1pvp5GR+2WH UA3IbVIERO36aUsk0mN1UKHNXjM/YbgeuAPCyGJ8v3qocRowBo8kUrO5rMGMrAw4dEtYbQg2J pADxdO9n/cPatV7ab3EvYa7wTrepY8OlCBhlknra6i2ZNaF1SRBrPlxHRHAD24CCfutAZuEqW PQ1wV/McWpA+IGhrCIpbWM+WQt/VYNwvzQ6M3c1jYbwuxXlIReiMlA5s12MhbL5hPPlMOBliv QaqPEEDwpD6k7WZ7Chrhy33Z/ABfv7ph75AlXBdlg8IvyLYOdgOn3F2/qfGg8rGUhahk= Subject: Re: [Caml-list] Use of unit testing frameworks in OCaml --=-xP7rpZ0f3/o/MLx6JhTX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Mittwoch, den 09.09.2015, 14:35 -0600 schrieb John Christopher McAlpine: > From what I can tell, the tests for the OCaml compiler and standard=20 > libraries are all done with a fairly small framework designed=20 > specifically for testing the compiler and standard libraries. Is there=20 > any particular reason not to use a tool such as OUnit or Broken for=20 > these tests? I am aware that adding dependencies to the compiler is=20 > generally frowned upon, but these libraries could significantly improve=20 > the maintainability of the core language and libraries. The last sentence is a quite strong thesis. Recently, I was in a similar situation as the OCaml developers, namely the need arose to create unit tests for a fairly large project (a commercial one, so I cannot point to it). I was considering oUnit. Finally, I dropped it, because it is not that useful at all. The point is that the most important function for unit-testing is polymorphic equality, and this is a built-in. All the other stuff is absolutely optional, and if you need it, just a matter of 10-20 lines (e.g. for selecting unit tests from the command-line - IF this is the applicable environment). It turns out the most useful are utility functions like let ( &&& ) x y =3D x && y (* logical AND without short-circuit eval *) or let named_check name p =3D if not p then printf "[FAILED: %s]" name; p which are typically missing in unit testing frameworks because these were once ported from imperative languages. E.g. a test could now look like let test0001() =3D named_check "subexpr1" (f 3 4 5 =3D 8) &&& named_check "subexpr2" (g 6 7 8 =3D 9) My experience is that all the other stuff you need is highly special to the project. What is the gain of maintainability you get by using a framework? Gerd --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-xP7rpZ0f3/o/MLx6JhTX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJV8L4zAAoJEAaM4b9ZLB5TCcYIAIduB3T6eFwVzP/zntWuR75b hU6G7GbwTGqKgCyNBxgsSevOHVxifvgnHG3lASZpenE9oqCjnd5AD+BzdD6ZY0BJ JcJSldtCQQwNk6+yPnVEqVdXw2ovx8FjvBVHiaZ6AFw/0x25ct82zhMRalRzCeef lDlfsLZljIu2/Po1HCzNFeeT9HSu2/O7r249IhxaroEJUGHNZLjn5NdHoQ7HQkNK YjxKvNFXDdy13RLfMmbqyTXfFeaaBdcC7vW8jz706y2vOCEo7xI7pL7dVOI6LLQD v0DYXxCP3MXjhUgHtVgmQCTWX+ky7992z9lOQLYmtwQUmh0/tTF0SWi8f+p9b3c= =1Xr1 -----END PGP SIGNATURE----- --=-xP7rpZ0f3/o/MLx6JhTX--