Share to: share facebook share twitter share wa share telegram print page

Correctness (computer science)

In theoretical computer science, an algorithm is correct with respect to a specification if it behaves as specified. Best explored is functional correctness, which refers to the input-output behavior of the algorithm: for each input it produces an output satisfying the specification.[1]

Within the latter notion, partial correctness, requiring that if an answer is returned it will be correct, is distinguished from total correctness, which additionally requires that an answer is eventually returned, i.e. the algorithm terminates. Correspondingly, to prove a program's total correctness, it is sufficient to prove its partial correctness, and its termination.[2] The latter kind of proof (termination proof) can never be fully automated, since the halting problem is undecidable.

Partially correct C program to find
the least odd perfect number,
its total correctness is unknown as of 2023
// return the sum of proper divisors of n
static int divisorSum(int n) {
   int i, sum = 0;
   for (i=1; i<n; ++i)
      if (n % i == 0)
         sum += i;
   return sum;
}
// return the least odd perfect number
int leastPerfectNumber(void) {
   int n;
   for (n=1; ; n+=2)
      if (n == divisorSum(n))
         return n;
}

For example, successively searching through integers 1, 2, 3, … to see if we can find an example of some phenomenon—say an odd perfect number—it is quite easy to write a partially correct program (see box). But to say this program is totally correct would be to assert something currently not known in number theory.

A proof would have to be a mathematical proof, assuming both the algorithm and specification are given formally. In particular it is not expected to be a correctness assertion for a given program implementing the algorithm on a given machine. That would involve such considerations as limitations on computer memory.

A deep result in proof theory, the Curry–Howard correspondence, states that a proof of functional correctness in constructive logic corresponds to a certain program in the lambda calculus. Converting a proof in this way is called program extraction.

Hoare logic is a specific formal system for reasoning rigorously about the correctness of computer programs.[3] It uses axiomatic techniques to define programming language semantics and argue about the correctness of programs through assertions known as Hoare triples.

Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results. Although crucial to software quality and widely deployed by programmers and testers, software testing still remains an art, due to limited understanding of the principles of software. The difficulty in software testing stems from the complexity of software: we can not completely test a program with moderate complexity. Testing is more than just debugging. The purpose of testing can be quality assurance, verification and validation, or reliability estimation. Testing can be used as a generic metric as well. Correctness testing and reliability testing are two major areas of testing. Software testing is a trade-off between budget, time and quality.[4]

See also

Notes

  1. ^ Dunlop, Douglas D.; Basili, Victor R. (June 1982). "A Comparative Analysis of Functional Correctness". Communications of the ACM. 14 (2): 229–244. doi:10.1145/356876.356881. S2CID 18627112.
  2. ^ Manna, Zohar; Pnueli, Amir (September 1974). "Axiomatic approach to total correctness of programs". Acta Informatica. 3 (3): 243–263. doi:10.1007/BF00288637. S2CID 2988073.
  3. ^ Hoare, C. A. R. (October 1969). "An axiomatic basis for computer programming" (PDF). Communications of the ACM. 12 (10): 576–580. CiteSeerX 10.1.1.116.2392. doi:10.1145/363235.363259. S2CID 207726175. Archived from the original (PDF) on 4 March 2016.
  4. ^ Pan, Jiantao (Spring 1999). "Software Testing" (coursework). Carnegie Mellon University. Retrieved 21 November 2017.

References

Read other articles:

SidomulyoKelurahanGapura selamat datang di Kelurahan SidomulyoNegara IndonesiaProvinsiSumatera UtaraKotaMedanKecamatanMedan TuntunganKodepos20137Kode Kemendagri12.71.07.1006 Kode BPS1275010002 Luas... km²Jumlah penduduk... jiwaKepadatan... jiwa/km² Untuk kegunaan lain, lihat Sidomulyo. Sidomulyo adalah kelurahan di kecamatan Medan Tuntungan, Medan, Sumatera Utara, Indonesia. Referensi (Indonesia) Keputusan Menteri Dalam Negeri Nomor 050-145 Tahun 2022 tentang Pemberian dan Pemutakhiran Ko…

Katekismus Besar Luther Judul asliDer Große KatechismusBahasaJermanTanggal terbit1529; 493 tahun lalu (1529) Katekismus Besar Luther (Jerman: Der Große Katechismus) adalah katekismus yang ditulis oleh Martin Luther. Katekismus ini terdiri dari beberapa bagian yang berdasarkan teks-teks kanonik Kristen, dan diterbitkan pada bulan April 1529.[1] Buku ini ditujukan terutama untuk membantu pendeta dalam mengajar jemaat. Katekismus Besar Luther dibagi menjadi lima bagian:…

2017 single by OG3NE Lights and ShadowsSingle by OG3NEfrom the album We Got This (Special Edition) Released3 March 2017GenrePopR&BsoulLength3:00LabelBMGSongwriter(s)Rick VolRory de KievitProducer(s)Rick VolRory de KievitOG3NE singles chronology Loved You First (2016) Lights and Shadows (2017) But I Do (2017) Eurovision Song Contest 2017 entryCountryNetherlandsArtist(s)OG3NELanguageEnglishComposer(s)Rory de KievitLyricist(s)Rick VolFinals performanceSemi-final result4thSemi-final points200Fin…

Laozi yang dilukiskan sebagai Manifestasi pimpinan Ajaran TAO Bagian dari seri tulisan mengenaiTaoisme Teori Dao (Tao) De (Te) Wuji Taiji Yin-Yang Wu wei Ziran Xian Wu Xing Qi Praktik Tiga Permata Meditasi Taois Diet Taois Neidan Praktik seksual Taois Kitab I Ching Laozi (Tao Te Ching) Zhuangzi Liezi Daozang Dewa-dewi Hongjun Laozu Tiga yang Murni Guan Shengdi Delapan Dewa Kaisar Kuning Li Hong Xiwangmu Kaisar Giok Dewa-dewi lainnya Tokoh Laozi Zhuangzi Zhang Daoling Zhang Jue Ge Hong Chen Tuan …

Polish sprinter (1946–2018) Irena SzewińskaIrena Szewińska in 2007Personal informationBorn(1946-05-24)24 May 1946Leningrad, Russian SFSR, Soviet UnionDied29 June 2018(2018-06-29) (aged 72)Warsaw, Poland[1]Height1.76 m (5 ft 9 in)Weight60 kg (132 lb)SportSportAthleticsClubPolonia Warszawa Medal record Representing  Poland Event 1st 2nd 3rd Olympic Games 3 2 2 European Championships 5 1 4 European Indoor Championships 2 2 2 Summer Universiade 2 1 0 To…

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (فبراير 2016) هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (…

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (يناير 2019) نادي الجندل السعودي الألوان الأحمر والأبيض تأسس عام 1396 هـ البلد السعودية  الدوري دوري الدرجة الثانية الس…

Municipio de Dale Municipio Municipio de DaleUbicación en el condado de Atchison en Misuri Ubicación de Misuri en EE. UU.Coordenadas 40°19′17″N 95°14′54″O / 40.321388888889, -95.248333333333Entidad Municipio • País  Estados Unidos • Estado  Misuri • Condado AtchisonSuperficie   • Total 211.39 km² • Tierra 211.35 km² • Agua (0.02 %) 0.03 km²Altitud   • Media 296 m s. n. m.Población …

Die Liste der Kulturdenkmale in Reick umfasst sämtliche Kulturdenkmale der Dresdner Gemarkung Reick. Die Anmerkungen sind zu beachten. Diese Liste ist eine Teilliste der Liste der Kulturdenkmale in Dresden. Diese Liste ist eine Teilliste der Liste der Kulturdenkmale in Sachsen. Inhaltsverzeichnis 1 Legende 2 Reick 3 Anmerkungen 4 Ausführliche Denkmaltexte 5 Quellen 6 Weblinks Legende Bild: Bild des Kulturdenkmals, ggf. zusätzlich mit einem Link zu weiteren Fotos des Kulturdenkmals im Medienar…

This is the results breakdown of the local elections held in Cantabria on 27 May 2007. The following tables show detailed results in the autonomous community's most populous municipalities, sorted alphabetically.[1][2][3] City control The following table lists party control in the most populous municipalities, including provincial capitals (shown in bold).[1] Gains for a party are displayed with the cell's background shaded in that party's colour. Municipality Pop…

Head of state and of government of the U.S. state of South Carolina For a list, see List of governors of South Carolina. Governor of South CarolinaSeal of the governorState flagIncumbentHenry McMastersince January 24, 2017Government of South CarolinaStyleHis ExcellencyResidenceGovernors MansionSeatColumbiaAppointerElected at-largeTerm lengthFour years, renewable once consecutivelyConstituting instrumentConstitution of South CarolinaInaugural holderWilliam SayleFormationMarch 15, 1670(3…

Ini adalah nama Tionghoa; marganya adalah Yin. Yin LihuaPermaisuri Dinasti Han TimurBerkuasa41 - 57PendahuluGuo ShengtongPenerusPermaisuri MaInformasi pribadiKelahiranYin Lihua5 MNanyang, HenanKematian64 (usia 58-59)Nama anumertaPermaisuri Guanglie (Hanzi: 光烈 皇后)AyahYin MuIbuNyonya DengPasanganLiu Xiu, Kaisar GuangwuAnakLiu Zhuang, Kaisar Ming Yin Lihua (Hanzi: 陰麗華; 5–64 M), secara resmi Permaisuri Guanglie (光烈皇后), merupakan permaisuri kedua Liu Xiu, Kaisar Guangw…

Spotted dickSpotted dickJenisPudingTempat asalInggris RayaBahan utamaLemak, buah kering Spotted dick adalah sejenis puding asal Inggris Raya dengan bahan dasar lemak serta buah-buah kering (umumnya kismis) dan disajikan dengan custard. Hidangan ini terbuat dari pastri berlemak yang ditaburi dengan buah-buahan kering, kemudian digulung menjadi puding berbentuk bundar.[1] Nama hidangan ini sering menjadi sumber lawakan karena memiliki makna ganda (dick yang dalam bahasa Inggris dapat menga…

Derris elliptica Batang merambat dan daun-daun tuba, Derris elliptica; dari Teupah Selatan, Simeulue, Aceh Klasifikasi ilmiah Kerajaan: Plantae Divisi: Magnoliophyta Kelas: Magnoliopsida Ordo: Fabales Famili: Fabaceae Genus: Derris Spesies: D. elliptica Nama binomial Derris elliptica Benth. Derris elliptica adalah spesies tuba (genus Derris) yang berasal dari Asia Tenggara dan kepulauan di Pasifik barat-daya yang biasa digunakan untuk meracun ikan. Meski ada beberapa jenis tuba (lihat: Tuba…

Motor vehicle Daewoo Tacuma (U100)OverviewManufacturerDaewoo (General Motors)Also calledDaewoo RezzoChevrolet TacumaChevrolet RezzoChevrolet VivantProduction2000–2008 (South Korea)2008–2009 (Uzbekistan)2008–2011 (Vietnam)AssemblyGunsan, South KoreaWarsaw, Poland (FSO)[1]Craiova, Romania (Rodae)[2]Asaka, Uzbekistan (GM)[3][4]Hanoi, Vietnam (VIDAMCO)[5]DesignerPininfarinaBody and chassisClassCompact MPVBody style5-door minivanLayoutFF layoutR…

This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Cyprus Historic and Classic Motor Museum – news · newspapers · books · scholar · JSTOR (December 2022) Automobile museum in Limassol , CyprusCyprus Historic and Classic Motor MuseumThe Cyprus Classic Motorcycle Museum in 2021EstablishedFebruary 2014…

Woman who became member of the family of painter Pierre-Auguste Renoir Gabrielle Renard and Jean Renoir, painted in 1895 by Pierre-Auguste Renoir The Artist's Family, Pierre-Auguste Renoir, 1896. Gabrielle with Rose, Pierre-Auguste Renoir, 1911. Gabrielle Renard (August 1, 1878 – February 26, 1959) was a French woman who became an important member of the family of the painter Pierre-Auguste Renoir, first becoming their nanny, and subsequently a frequent model for the artist.[1] The bon…

Badai pasir mendekati Al Asad, Irak, pada 27 April 2005. Badai pasir adalah fenomena meteorologi yang umum di wilayah arid dan semi-arid. Badai pasir antara lain disebabkan oleh meningkatnya kecepatan angin dalam suatu wilayah yang luas. Badai pasir umumnya terjadi pada tanah yang kering. Badai pasir dapat memindahkan keseluruhan bukit pasir dan membawa pasir dalam jumlah besar sehingga tepi badai dapat menyerupai dinding pasir setinggi 1,6 km. Badai pasir di gurun Sahara dalam bahasa setem…

Large woodworking hand plane used for flattening and jointing workpieces For the woodworking machine, see Jointer.Jointer planeA Stanley #7 jointer planeWooden jointer from c.1880Other namesTry planeTrying planeTrueing plane[1]Used withJack plane and smoothing planeThe jointer plane, also known as the try plane or trying plane, is a type of hand plane used in woodworking to straighten the edges of boards in the process known as jointing, and to flatten the faces of larger boards.[2&#…

  لمعانٍ أخرى، طالع براد إيفانز (توضيح). براد إيفانز   معلومات شخصية الميلاد 20 أبريل 1985 (38 سنة)[1]  فينيكس  الطول 185 سنتيمتر  مركز اللعب لاعب وسط،  ومُدَافِع[1]  الجنسية الولايات المتحدة  المدرسة الأم جامعة كاليفورنيا  مسيرة الشباب سنوات فريق 1993–…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 18.191.59.102