1 / 17

Automated Test Generation

Automated Test Generation. Recent advanced technique: Dynamic Symbolic Execution/ Concolic Testing Instrument code to explore feasible paths Example tool: Pex from Microsoft Research (for .NET programs).

felcia
Download Presentation

Automated Test Generation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automated Test Generation • Recent advanced technique: Dynamic Symbolic Execution/Concolic Testing • Instrument code to explore feasible paths • Example tool: Pex from Microsoft Research (for .NET programs) P. Godefroid, N. Klarlund, and K. Sen. DART: directed automated random testing. In Proc. PLDI 2005 K. Sen, D. Marinov, and G. Agha. CUTE: a concolic unit testing engine for C. In Proc. ESEC/FSE 2005 N. Tillmann and J. de Halleux. Pex - White Box Test Generation for .NET. In Proc. TAP 2008

  2. Dynamic Symbolic Execution in Pex void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } http://pex4fun.com/HowDoesPexWork

  3. Dynamic Symbolic Execution in Pex void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Input • null http://pex4fun.com/HowDoesPexWork

  4. Dynamic Symbolic Execution in Pex Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Observed constraints • a==null • Input • null a==null T http://pex4fun.com/HowDoesPexWork

  5. Dynamic Symbolic Execution in Pex Choose next path Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • Observed constraints • a==null • Input • null a==null T http://pex4fun.com/HowDoesPexWork

  6. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • Observed constraints • a==null • Input • null • {} a==null T http://pex4fun.com/HowDoesPexWork

  7. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • Observed constraints • a==null • a!=null && • !(a.Length>0) • Input • null • {} a==null T F a.Length>0 F http://pex4fun.com/HowDoesPexWork

  8. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • Observed constraints • a==null • a!=null && • !(a.Length>0) • Input • null • {} a==null T F a.Length>0 F http://pex4fun.com/HowDoesPexWork

  9. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • Observed constraints • a==null • a!=null && • !(a.Length>0) • Input • null • {} • {0} a==null T F a.Length>0 T F a[0]==123… F http://pex4fun.com/HowDoesPexWork

  10. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • Observed constraints • a==null • a!=null && • !(a.Length>0) • a==null && • a.Length>0 && • a[0]!=1234567890 • Input • null • {} • {0} a==null T F a.Length>0 T F a[0]==123… F http://pex4fun.com/HowDoesPexWork

  11. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • a!=null && • a.Length>0 && • a[0]==123456890 • Observed constraints • a==null • a!=null && • !(a.Length>0) • a==null && • a.Length>0 && • a[0]!=1234567890 • Input • null • {} • {0} a==null T F a.Length>0 T F a[0]==123… F http://pex4fun.com/HowDoesPexWork

  12. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • a!=null && • a.Length>0 && • a[0]==123456890 • Observed constraints • a==null • a!=null && • !(a.Length>0) • a==null && • a.Length>0 && • a[0]!=1234567890 • Input • null • {} • {0} • {123…} a==null T F a.Length>0 T F a[0]==123… F http://pex4fun.com/HowDoesPexWork

  13. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • a!=null && • a.Length>0 && • a[0]==123456890 • Observed constraints • a==null • a!=null && • !(a.Length>0) • a==null && • a.Length>0 && • a[0]!=1234567890 • a==null && • a.Length>0 && • a[0]==1234567890 • Input • null • {} • {0} • {123…} a==null T F a.Length>0 T F a[0]==123… F T http://pex4fun.com/HowDoesPexWork

  14. Dynamic Symbolic Execution in Pex Choose next path Solve Execute&Monitor void CoverMe(int[] a) { if (a == null) return; if (a.Length > 0) if (a[0] == 1234567890) throw new Exception("bug"); } • Constraints to solve • a!=null • a!=null && • a.Length>0 • a!=null && • a.Length>0 && • a[0]==123456890 • Observed constraints • a==null • a!=null && • !(a.Length>0) • a==null && • a.Length>0 && • a[0]!=1234567890 • a==null && • a.Length>0 && • a[0]==1234567890 • Input • null • {} • {0} • {123…} a==null T F a.Length>0 T Done: There is no path left. F a[0]==123… F T http://pex4fun.com/HowDoesPexWork

  15. Automating Test Generation @NCSU ASE • Method sequences • MSeqGen/Seeker [Thummalapenta et al. OOSPLA 11, ESEC/FSE 09], Covana[Xiao et al. ICSE 2011], OCAT [Jaygarl et al. ISSTA 10], Evacon[Inkumsah et al. ASE 08], Symclat[d'Amorim et al. ASE 06] • Environments e.g., db, file systems, network, … • DBApp Testing [Taneja et al. ESEC/FSE 11], [Pan et al. ASE 11] • CloudApp Testing [Zhang et al. IEEE Soft 12] • Loops • Fitnex[Xie et al. DSN 09] http://people.engr.ncsu.edu/txie/publications.htm

  16. Pex on MSDN DevLabsIncubation Project for Visual Studio • Download counts (20 months)(Feb. 2008 - Oct. 2009 ) • Academic: 17,366 • Devlabs: 13,022 • Total: 30,388 http://research.microsoft.com/projects/pex/

  17. Testing Tool Educational Gaming DSE/Pex secret Support Pex for Fun: Interactive Gaming for Teaching and Learning http://research.microsoft.com/pex/ http://pex4fun.com

More Related