abstract = "Automatically generating executable code has a long
history of arguably modest success, mostly limited to
the generation of small programs of up to 200 lines of
code, and genetic improvement of existing code. We
present the use of genetic programming (GP) in
conjunction with context-oriented behavioural
programming (COBP), the latter being a programming
paradigm with unique characteristics that facilitate
automatic coding. COBP models a program as a set of
behavioural threads (b-threads), each aligned to a
single behaviour or requirement of the system. To
evolve behavioural programs we design viable and
effective genetic operators, a genetic representation,
and evaluation methods. The simplicity of the COBP
paradigm, its straightforward syntax, the ability to
use verification and formal-method techniques to
validate program correctness, and a program comprising
small independent chunks all allow us to effectively
generate behavioural programs using GP. To demonstrate
our approach we evolve complete programs from scratch
of a highly competent O player for the game of
tic-tac-toe. The evolved programs are well structured,
consisting of multiple, explainable modules that
specify the different behavioural aspects of the
program and are similar to our handcrafted program. To
validate the correctness of our individuals, we use the
mathematical characteristics of COBP to analyse program
behaviour under all possible execution paths. Our
analysis of an evolved program proved that it plays as
expected more than 99percent of the times.",