Automated Software Engineering Writing Code to Help You Write Code. Gregory Gay CSCE Computing in the Modern World October 27, 2015

Similar documents
Local Search: Hill Climbing. When A* doesn t work AIMA 4.1. Review: Hill climbing on a surface of states. Review: Local search and optimization

SWARM INTELLIGENCE. Mario Pavone Department of Mathematics & Computer Science University of Catania

Automating a Solution for Optimum PTP Deployment

Fault Location Using Sparse Wide Area Measurements

Achieving Desirable Gameplay Objectives by Niched Evolution of Game Parameters

Wire Layer Geometry Optimization using Stochastic Wire Sampling

Evolution of Sensor Suites for Complex Environments

UT^2: Human-like Behavior via Neuroevolution of Combat Behavior and Replay of Human Traces

CPS331 Lecture: Genetic Algorithms last revised October 28, 2016

A comparison of a genetic algorithm and a depth first search algorithm applied to Japanese nonograms

A New Approach to the Design and Verification of Complex Systems

Information Systemss and Software Engineering. Computer Science & Information Technology (CS)

Automated Testing of Autonomous Driving Assistance Systems

Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Multi-Robot Coordination. Chapter 11

Creating a Poker Playing Program Using Evolutionary Computation

A Review on Genetic Algorithm and Its Applications

Evolutionary robotics Jørgen Nordmoen

Behavioral Adaptations for Survival 1. Co-evolution of predator and prey ( evolutionary arms races )

GENETIC PROGRAMMING. In artificial intelligence, genetic programming (GP) is an evolutionary algorithmbased

Analysis of Vanilla Rolling Horizon Evolution Parameters in General Video Game Playing

Introduction to co-simulation. What is HW-SW co-simulation?

Population Initialization Techniques for RHEA in GVGP

A Genetic Algorithm for Solving Beehive Hidato Puzzles

NUMERICAL SIMULATION OF SELF-STRUCTURING ANTENNAS BASED ON A GENETIC ALGORITHM OPTIMIZATION SCHEME

Unit 5: Unified Software Development Process. 3C05: Unified Software Development Process USDP. USDP for your project. Iteration Workflows.

Software Engineering

CS188: Section Handout 1, Uninformed Search SOLUTIONS

Shuffled Complex Evolution

The Genetic Algorithm

Solving and Analyzing Sudokus with Cultural Algorithms 5/30/2008. Timo Mantere & Janne Koljonen

Enhancing Embodied Evolution with Punctuated Anytime Learning

Introduction to Genetic Algorithms

Online Evolution for Cooperative Behavior in Group Robot Systems

Service-Oriented Software Engineering - SOSE (Academic Year 2015/2016)

Genetic Algorithms with Heuristic Knight s Tour Problem

Focusing Software Education on Engineering

COMPUTATONAL INTELLIGENCE

Keytar Hero. Bobby Barnett, Katy Kahla, James Kress, and Josh Tate. Teams 9 and 10 1

USING GENETIC ALGORITHMS TO EVOLVE CHARACTER BEHAVIOURS IN MODERN VIDEO GAMES

Threat Modeling the Minecraft Way

Despite the euphonic name, the words in the program title actually do describe what we're trying to do:

Genealogical trees, coalescent theory, and the analysis of genetic polymorphisms

Co-evolution for Communication: An EHW Approach

Documentation and Discussion

TJHSST Senior Research Project Evolving Motor Techniques for Artificial Life

Developing Frogger Player Intelligence Using NEAT and a Score Driven Fitness Function

UNIT VIII SYSTEM METHODOLOGY 2014

Course Introduction and Overview of Software Engineering. Richard N. Taylor Informatics 211 Fall 2007

Review of Soft Computing Techniques used in Robotics Application

Swarmathon Module 5: Final Project

Intersections of Philosophy Logic and Biology in Design

Lecture 10: Memetic Algorithms - I. An Introduction to Meta-Heuristics, Produced by Qiangfu Zhao (Since 2012), All rights reserved

Welcome to the Sudoku and Kakuro Help File.

Examen. NU reproducere mecanica ASPC, P11. Foundations of Software Engineering

Introduction to Systems Engineering

SWEN 256 Software Process & Project Management

By the end of this chapter, you should: Understand what is meant by engineering design. Understand the phases of the engineering design process.

A Genetic Algorithm-Based Controller for Decentralized Multi-Agent Robotic Systems

CYCLIC GENETIC ALGORITHMS FOR EVOLVING MULTI-LOOP CONTROL PROGRAMS

Real-time Grid Computing : Monte-Carlo Methods in Parallel Tree Searching

Building Effective Seed Models For Adaptive Process Control. John Campbell Director, APC Product Management AspenTech

Generating Interesting Patterns in Conway s Game of Life Through a Genetic Algorithm

Ethics. Paul Jackson. School of Informatics University of Edinburgh

Appendix A. Selected excerpts from behavior modeling session Examples of training screens

Smart Grid Reconfiguration Using Genetic Algorithm and NSGA-II

January 11, 2017 Administrative notes

Instrumentation, Controls, and Automation - Program 68

Solving Sudoku with Genetic Operations that Preserve Building Blocks

A Multi-Population Parallel Genetic Algorithm for Continuous Galvanizing Line Scheduling

Current challenges in automatic software repair

Computer Science. Using neural networks and genetic algorithms in a Pac-man game

Implementation and Comparison the Dynamic Pathfinding Algorithm and Two Modified A* Pathfinding Algorithms in a Car Racing Game

SAFETY CASES: ARGUING THE SAFETY OF AUTONOMOUS SYSTEMS SIMON BURTON DAGSTUHL,

Improving Evolutionary Algorithm Performance on Maximizing Functional Test Coverage of ASICs Using Adaptation of the Fitness Criteria

Differential Evolution and Genetic Algorithm Based MPPT Controller for Photovoltaic System

Mid Term Exam SES 405 Exploration Systems Engineering 3 March Your Name

Multi-objective Optimization Inspired by Nature

Evolving Control for Distributed Micro Air Vehicles'

Seven Things You Must Know Before Hiring a Roofing Company

RISTO MIIKKULAINEN, SENTIENT ( SATIENT/) APRIL 3, :23 PM

Swarm Intelligence W7: Application of Machine- Learning Techniques to Automatic Control Design and Optimization

Technical-oriented talk about the principles and benefits of the ASSUMEits approach and tooling

ARRANGING WEEKLY WORK PLANS IN CONCRETE ELEMENT PREFABRICATION USING GENETIC ALGORITHMS

Chapter 1: Introduction to Neuro-Fuzzy (NF) and Soft Computing (SC)

Chapter 12 Summary Sample Surveys

Evolutionary Robotics. IAR Lecture 13 Barbara Webb

Available online at ScienceDirect. Procedia Computer Science 24 (2013 )

Solving Assembly Line Balancing Problem using Genetic Algorithm with Heuristics- Treated Initial Population

A NEW SOFTWARE PROCESS MODEL DESIGNED FROM THE BASICS OF EVOLUTIONARY BIOLOGY AND SOFTWARE EVOLUTION MURUGAPPAN RAMANATHAN

Your Guide to Quality Furnace Maintenance, Repair, and Replacement

Approaching The Royal Game of Ur with Genetic Algorithms and ExpectiMax

INTERACTIVE DYNAMIC PRODUCTION BY GENETIC ALGORITHMS

Evolutionary Image Enhancement for Impulsive Noise Reduction

Optimization of Tile Sets for DNA Self- Assembly

CSC 396 : Introduction to Artificial Intelligence

FOUR TOTAL TRANSFER CAPABILITY. 4.1 Total transfer capability CHAPTER

LANDSCAPE SMOOTHING OF NUMERICAL PERMUTATION SPACES IN GENETIC ALGORITHMS

Mehrdad Amirghasemi a* Reza Zamani a

Transcription:

Automated Software Engineering Writing Code to Help You Write Code Gregory Gay CSCE 190 - Computing in the Modern World October 27, 2015

Software Engineering The development and evolution of high-quality (large) software systems in a systematic, controlled, and efficient manner. Necessary because society depends on software. Gregory Gay Software Engineering 2

Flawed Software Will Be Exploited Gregory Gay Software Engineering 3

Software Can Hurt People In 2010, software problems were responsible for 26% of medical device recalls. There is a reasonable probability that use of these products will cause serious adverse health consequences or death. - US Food and Drug Administration Gregory Gay Software Engineering 4

Why Software Engineering? Good engineering is difficult and expensive. It costs 50% more per instruction to develop high-dependability software than to develop low-dependability software. - Victor Basili (Emeritus Professor, UMD) Software engineering is focused on lowering the cost and difficulty, and improving the quality, of software development. Gregory Gay Software Engineering 5

The Need for Disciplined Practices The job of software engineers is to: produce high-quality products produce them on schedule and do this within planned costs You should start learning now (you ll want the practice). Gregory Gay Software Engineering 6

Developers in Demand Developers Available Demand for Software Skilled Developers Developers Available Gregory Gay Software Engineering 7

What is the largest programming project you ve ever worked on?

How did you design and build it?

What are the largest pieces of software in the world?

Typical Development Process Concept Formation Requirements Specification Design Release and Maintenance Implementation and Testing Gregory Gay Software Engineering 11

Focus Areas in SE Development Processes How people work together to create software. Requirements Engineering How to formally describe the properties and expected behavior of the software we will build. Software Design and Architecture How to design robust and efficient systems. Software Testing & Verification How to ensure that software is correct and free of faults. Gregory Gay Software Engineering 12

Why do we need all of this documentation? - Nearly Every Student Ever Gregory Gay Software Engineering 13

Automated Software Engineering: Writing code to help you write code.

Testing Requires Writing Code Testing requires writing code to break your code. Sometimes, you write more code to test than is in the original software. Gregory Gay Software Engineering 15

Testing Requires Writing Code Unit Tests Instantiates classes. Passes in input to functions. Checks output against expectations. Environment Simulation Models physical environment. Experiment with different network and hardware configurations. Component Mocking Fake behavior for undeveloped classes. Gregory Gay Software Engineering 16

Testing is Expensive Testing often claims over 50% of the development time and budget. Many parts of testing are labor-intensive: Coming up with input and expected outputs. Tracing a fault to its source in the code. Fixing the code without breaking other code. (and basically everything else) Gregory Gay Software Engineering 17

Automated Testing: Writing code that writes code that breaks code.

Automated Test Generation If we can score test quality, then we have an optimization goal. Treat test generation as a search problem. Generate a test (or set of tests). Score each of them by their adequacy. Manipulate the population according to a search strategy (a heuristic ). Gregory Gay Software Engineering 19

Metaheuristic Search Most search spaces are too large to exhaustively explore. Instead, choose a smart strategy to stochastically sample from that space. We can t guarantee an optimal solution but if we re smart, we ll hit something close enough. Metaheuristic search is computationally feasible on problems where complete search is not. Gregory Gay Software Engineering 20

Local Search Generate a potential solution. Score it using your fitness function. Attempt to improve it by looking at its local neighborhood. Keep making small, incremental improvements. Very fast and efficient if you make a good initial guess. Can get stuck in local maxima if not. Reset strategies help. Gregory Gay Software Engineering 21

Global Search Generate a potential solution (or set of solutions). Score them. At a certain probability, sample from other regions of the space. Strategies typically based on natural processes - swarm attack patterns, ant colony behavior, species evolution. Gregory Gay Software Engineering 22

Genetic Algorithms Over multiple generations, evolve a population - favoring good solutions and filtering out bad solutions. Diversity is introduced to the population each generation by: Keeping some of the best solutions. Randomly generating some population members. Creating offspring through mutation and gene crossover. Gregory Gay Software Engineering 23

Genetic Algorithms - Mutation Gregory Gay Software Engineering 24

Genetic Algorithms - Crossover Gregory Gay Software Engineering 25

Fitness Functions Solutions are judged by a fitness function that takes in the solution and calculates a score. Distance from the current solution to the ideal solution. How close are you to covering a testing goal? Smaller scores are typically better. Must offer information to guide the search. Must be cheap to calculate - performed 100s-1000s of times per generation. Gregory Gay Software Engineering 26

Not Just Test Generation... Metaheuristic search can be applied to any problem with: A large search space. Fitness function and solution generation methods with low computational complexity. Approximate continuity in the fitness function. No known optimal solution. Gregory Gay Software Engineering 27

Writing code that writes code that breaks code. fixes

Automated Program Repair Popular projects may have hundreds of bugs reported per day. Repair techniques, like GenProg, automatically produce patches that can repair common bug types. Many bugs can be fixed with just a few changes to the source code - inserting new code, deleting or moving existing code. GenProg uses the same ideas to search for repairs automatically. Gregory Gay Software Engineering 29

GenProg Genetic programming - solutions represent sequences of edits to the source code. Each candidate patch is applied to the program to produce a new program. See if the patched program passes all tests. Fitness function: how many tests pass? Use crossover and mutation to evolve better patches. Gregory Gay Software Engineering 30

GenProg Results GenProg repaired 55 out of 105 bugs at an average cost of $8 per bug. Large projects - over 5 million lines of code, 10000 test cases. Able to patch infinite loops, segmentation faults, buffer overflows, denial of service vulnerabilities, wrong output faults, and more. Gregory Gay Software Engineering 31

Automated Code Transplantation Not just patches Many coding tasks involve reinventing the wheel - redesigning and writing code to perform a function that already exists in some other project. What if we could slice out that code ( organ ) from a donor program and transplant it to the right vein in the target software? Gregory Gay Software Engineering 32

muscalpel Uses a form of genetic programming. Initial population of 1 statement patches. Organs need very few statements from the donor. Starting with one line at a time allows muscalpel to find efficient solutions quickly. Search evolves both organs and veins. Optimize the set of code transplanted from the donor, and the optimal location to place that code in the target software. Apply tests to ensure correctness of both original code and new features. Gregory Gay Software Engineering 33

muscalpel Results Transplantation of H.264 video codec from x264 system to VLC media player. Took VLC developers 20 days to write the code manually. Took muscalpal 26 hours to transplant automatically. In 12 of 15 experiments, successful transplants that passed all tests. Gregory Gay Software Engineering 33

We still need good engineers.

Are you that engineer?

Questions and Discussion Interested in discussing more? E-Mail: greg@greggay.com Web: http://www.greggay.com In-Person: 3A66 SWGN Gregory Gay Software Engineering 37