Contracts, tools, verification K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Keynote, ASWEC 2010; Auckland, NZ;

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA, USA Invited talk Informatics Education in Europe (IEE III’08)
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Payroll and HR Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
FonePlus Hugh Teegan Architect Mobile Devices Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
Ctrl-K, X Ctrl-K, S
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

Contracts, tools, verification K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Keynote, ASWEC 2010; Auckland, NZ; 8 April 2010

Research in Software Engineering Microsoft Research, Redmond Related groups: PPT (MSR Cambridge) and RSE (MSR India) [picture: Microsoft Research]

with the right features that is easy to use that is hard to misuse accidentally maliciously can be developed effectively on schedule free of defects can be maintained to add features to adapt to new environments to preserve/transfer knowledge between developers K.R.M. Leino, ASWEC 2010

Semantics Specifications (contracts) Tools K.R.M. Leino, ASWEC 2010

Add assertions on edges of the program’s flow graph K.R.M. Leino, ASWEC ≤ N r 2 ≤ N r 2 ≤ N ⋀ (r+1) 2 ≤ N r 2 ≤ N < (r+1) 2 yesno [picture: sigact.acm.org/floyd]

S is a program P and Q are assertions (predicates, conditions) about the program state The triple says: started in a state satisfying P, every outcome of S will satisfy Q K.R.M. Leino, ASWEC 2010 { P } S { Q } [picture: Microsoft Research]

{ 0 ≤ N } { r 2 ≤ N } { r 2 ≤ N ⋀ (r+1) 2 ≤ N } { r 2 ≤ N } { r 2 ≤ N < (r+1) 2 } K.R.M. Leino, ASWEC 2010 r := 0; while (r+1) 2 ≤ N do r := r + 1 end Loop invariant

For { P } S { Q } Given P and S, the most precise assertion Q is called their strongest postcondition, denoted sp(S, P) Given S and Q, the most general assertion P is called their weakest precondition, denoted wp(S, Q) sp(S, P) ⇒ Q P ⇒ wp(S, Q) non-determinism easy calculates the conditions (especially for ; ) K.R.M. Leino, ASWEC 2010 [picture:

… to engineering reality K.R.M. Leino, ASWEC 2010

Symbolic execution K.R.M. Leino, ASWEC ≤ x 0 ≤ x ⋀ y = x x < 0 x < 0 ⋀ y = -x y = abs(x) [picture:site07.goscon.org/speaker]

Abstract interpretation Automatically compute fix-points for loops using given a domain K.R.M. Leino, ASWEC 2010 [picture: Leino]

Cooperating decision procedures Instantiating quantifiers K.R.M. Leino, ASWEC 2010 [picture: Compaq Research]

Specifications (contracts) in an object-oriented programming language A precondition is a contract that says what is to hold on entry to a procedure caller’s responsibility to establish implementation can assume on entry A postcondition is a contract that says what is to hold on exit from a procedure implementation’s responsibility to establish caller can assume upon return K.R.M. Leino, ASWEC 2010 [picture:cacm.acm.org/blogs/blog-cacm/48033]

Spec# Formatting phone numbers

K.R.M. Leino, ASWEC 2010 contractscontracts wpwp abstract interpretation decision procedures

Dafny ISqrt

PREfix, PREfast [Pincus, Sielaff, et al., 1999-] symbolic execution partial summaries sort error messages by priority applied to Windows SLAM, SDV [Ball, Rajamani, et al., 2001-] model checking (symbolic execution) counterexample-guided predicate abstraction applied to device drivers Code Contracts [Barnett, Fähndrich, Grunkemeyer, Logozzo, et al., 2009-] used in.NET library K.R.M. Leino, ASWEC 2010

Contract library Binary rewriter Static analyzer (Clousot) Test generator (Pex) K.R.M. Leino, ASWEC 2010

Code Contracts Trim Suffix

Contracts help define interfaces shape thinking are used in practice Contracts need tools … and give the opportunity to use/apply tools In the extreme, can lead to full verification K.R.M. Leino, ASWEC 2010 Code Contractsresearch.microsoft.com/contractsresearch.microsoft.com/contracts Spec#specsharp.codeplex.comspecsharp.codeplex.com Dafny and Boogieboogie.codeplex.comboogie.codeplex.com Projects and videosresearch.microsoft.com/riseresearch.microsoft.com/rise Various papersresearch.microsoft.com/~leino/papers.htmlresearch.microsoft.com/~leino/papers.html Code Contractsresearch.microsoft.com/contractsresearch.microsoft.com/contracts Spec#specsharp.codeplex.comspecsharp.codeplex.com Dafny and Boogieboogie.codeplex.comboogie.codeplex.com Projects and videosresearch.microsoft.com/riseresearch.microsoft.com/rise Various papersresearch.microsoft.com/~leino/papers.htmlresearch.microsoft.com/~leino/papers.html

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.