In computer programming, an assertion is a predicate (i.e. , a true–false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place. For example, the following code contains two assertions: x := 5; x > 0 x := x + 1 x > 1 x > 0 and x > 1, and they are indeed true at the indicated points during execution. Assertions are used to help specify programs and to reason about program correctness.
| Property | Value |
| dbpprop:abstract
|
- In computer programming, an assertion is a predicate (i.e. , a true–false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place. For example, the following code contains two assertions: x := 5; x > 0 x := x + 1 x > 1 x > 0 and x > 1, and they are indeed true at the indicated points during execution. Assertions are used to help specify programs and to reason about program correctness. For example, a precondition — an assertion placed at the beginning of a section of code — determines the set of states under which the code is expected to be executed. A postcondition — placed at the end — describes the expected state at the end of execution. The example above uses the notation for including assertions used by C.A.R. Hoare in his 1969 paper . That notation cannot be used in existing mainstream programming languages. However, programmers can include unchecked assertions using the comment feature of their programming language. Here is an example using C: x = 5; // x > 0 x = x + 1; // x > 1 The braces are included in the comment in order to help distinguish this use of a comment from other uses. Several modern programming languages include checked assertions - statements that are checked at runtime or sometimes statically. If an assertion evaluates to false at run-time, an "assertion failure" results, which typically causes execution to abort. This draws attention to the location at which the logical inconsistency is detected and can be preferable to the behaviour that would otherwise result. The use of assertions helps the programmer design, develop, and reason about a program.
- Eine Zusicherung oder Assertion (lat. /engl. für Aussage; Behauptung) ist eine Aussage über den Zustand eines Computer-Programms oder einer elektronischen Schaltung. Mit Hilfe von Zusicherungen können logische Fehler im Programm oder Defekte in der umgebenden Hard- oder Software erkannt und das Programm kontrolliert beendet werden. Bei der Entwicklung elektronischer Schaltungen kann mittels Assertions die Einhaltung der Spezifikation in der Verifikationsphase überprüft werden. Des Weiteren können Assertions Informationen über den Grad der Testabdeckung während der Verifikation liefern.
- 表明(ひょうめい、Assertion)とは、プログラミング言語の構文の一種であり、そのプログラムの前提条件を示すのに使われる。アサーションとも呼ばれる。表明は、プログラムのその箇所で必ず真であるべき式の形式をとる。多くの言語ではそのような前提条件のチェックに表明を使用するが、設計上の判断を文書化するのに使う場合もある。表明が偽となった場合、プログラムにバグが潜在していることを示している。これを「表明違反; assertion failure」と呼ぶ。 プログラマは、開発過程でソースコードに表明を追加する。デバッグを単純化し、問題を早期に検出するためである。表明違反はバグを示していることが多いため、表明の実装では問題の元を示すために追加情報を表示するようになっていることが多い(ソースコードのファイル名と行番号、スタックトレースなど)。ほとんどの実装では、そのプログラムの実行が即座に停止する。
- Een assertie is in programmeertalen een predicaat (waar of onwaar) dat door de ontwikkelaar in de broncode van een computerprogramma geplaatst kan worden om aan te geven dat een bepaalde voorwaarde op die plaats altijd als waar wordt verondersteld. Een assertie helpt de ontwikkelaar bij het ontwerpen, ontwikkelen en nadenken over een programma. Een assertie kan ook behulpzaam zijn bij het opsporen van fouten in een programma: als een assertie faalt dan weet de programmeur dat er ergens een fout zit.
- W programowaniu asercja to predykat (forma zdaniowa w danym języku, która zwraca prawdę lub fałsz), umieszczony w pewnym miejscu w kodzie. Wskazuje on że programista zakłada, że predykat ów jest prawdziwy. W przypadku gdy predykat jest fałszywy (czyli nie spełnione są warunki postawione przez programistę) asercja powoduje przerwanie wykonania programu. Asercja ma szczególne zastosowanie w trakcie testowania tworzonego oprogramowania, np. dla sprawdzenia luk lub jego odporności na błędy. Zaletą stosowania asercji jest możliwość sprawdzenia, w którym fragmencie kodu źródłowego programu nastąpił błąd.
- Утверждение в программировании — предикат, размещённый в программе и указывающий на то, что разработчик имеет ввиду этот предикат в этом месте программы всегда истинным. К примеру, следующий псевдокод содержит два утверждения: <source lang="java">x := 5; {x > 0} x := x + 1 {x > 1}</source> x > 0 и x > 1, и они безусловно верны в указанных точках в момент выполнения.
- Тве́рдження ({{lang-en|Assertion), в програмуванні — висловлювання на мові програмування в якому робиться припущення щодо властивостей змінних або стану програми. Це висловлювання формулюється в такому вигляді, що припускається його значення істина. Більшість мов програмування використовують твердження для перевірки таких припущень, однак, інші використовують їх для документування проектних рішень. У разі, якщо твердження не виконується, це може вказувати на наявність помилки в програмі.
|
| dbpprop:hasPhotoCollection
| |
| dbpprop:reference
| |
| rdfs:comment
|
- In computer programming, an assertion is a predicate (i.e. , a true–false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place. For example, the following code contains two assertions: x := 5; x > 0 x := x + 1 x > 1 x > 0 and x > 1, and they are indeed true at the indicated points during execution. Assertions are used to help specify programs and to reason about program correctness.
- Eine Zusicherung oder Assertion (lat. /engl. für Aussage; Behauptung) ist eine Aussage über den Zustand eines Computer-Programms oder einer elektronischen Schaltung. Mit Hilfe von Zusicherungen können logische Fehler im Programm oder Defekte in der umgebenden Hard- oder Software erkannt und das Programm kontrolliert beendet werden. Bei der Entwicklung elektronischer Schaltungen kann mittels Assertions die Einhaltung der Spezifikation in der Verifikationsphase überprüft werden.
- Een assertie is in programmeertalen een predicaat (waar of onwaar) dat door de ontwikkelaar in de broncode van een computerprogramma geplaatst kan worden om aan te geven dat een bepaalde voorwaarde op die plaats altijd als waar wordt verondersteld. Een assertie helpt de ontwikkelaar bij het ontwerpen, ontwikkelen en nadenken over een programma.
- W programowaniu asercja to predykat (forma zdaniowa w danym języku, która zwraca prawdę lub fałsz), umieszczony w pewnym miejscu w kodzie. Wskazuje on że programista zakłada, że predykat ów jest prawdziwy. W przypadku gdy predykat jest fałszywy (czyli nie spełnione są warunki postawione przez programistę) asercja powoduje przerwanie wykonania programu. Asercja ma szczególne zastosowanie w trakcie testowania tworzonego oprogramowania, np.
- Утверждение в программировании — предикат, размещённый в программе и указывающий на то, что разработчик имеет ввиду этот предикат в этом месте программы всегда истинным.
- Тве́рдження ({{lang-en|Assertion), в програмуванні — висловлювання на мові програмування в якому робиться припущення щодо властивостей змінних або стану програми. Це висловлювання формулюється в такому вигляді, що припускається його значення істина.
|
| rdfs:label
|
- Assertion (computing)
- Assertion (Informatik)
- 表明
- Assertie
- Asercja (informatyka)
- Утверждение (программирование)
- Твердження (програмування)
|
| owl:sameAs
| |
| skos:subject
| |
| foaf:page
| |
| is dbpprop:disambiguates
of | |
| is dbpprop:redirect
of | |