10.01.2015 Views

Teaching formal methods in the context of software engineering

Teaching formal methods in the context of software engineering

Teaching formal methods in the context of software engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FMET – Formally Reviewed Papers<br />

have adopted a systematic, step-by-step curriculum for<br />

<strong>formal</strong> <strong>methods</strong> education <strong>in</strong> <strong>the</strong> Department <strong>of</strong> Computer<br />

Science at Hosei University. Although it is still not perfect<br />

yet <strong>in</strong> <strong>the</strong> sense <strong>of</strong> <strong>in</strong>volv<strong>in</strong>g all students <strong>in</strong> <strong>the</strong> department,<br />

<strong>the</strong> curriculum has proved to be effective and successful<br />

among <strong>the</strong> students who have received <strong>the</strong> education<br />

accord<strong>in</strong>g to our experience over <strong>the</strong> last n<strong>in</strong>e years <strong>of</strong><br />

practice.<br />

The curriculum is arranged as follows. We <strong>in</strong>troduce<br />

simple VDM-like operation specification techniques to <strong>the</strong><br />

first year students <strong>of</strong> four-year undergraduate education,<br />

more complicated specification techniques to <strong>the</strong> second<br />

year students, and a systematic <strong>formal</strong> eng<strong>in</strong>eer<strong>in</strong>g <strong>methods</strong><br />

course to <strong>the</strong> third year students, and f<strong>in</strong>ally require <strong>the</strong><br />

students <strong>in</strong> <strong>the</strong> S<strong>of</strong>tware Eng<strong>in</strong>eer<strong>in</strong>g Laboratory for<br />

Dependable Systems (SELDS) to apply <strong>the</strong> learned <strong>formal</strong><br />

techniques <strong>in</strong> <strong>the</strong>ir graduation projects. All <strong>of</strong> <strong>the</strong>se classes<br />

are optional. For <strong>the</strong> students who proceed to <strong>the</strong><br />

postgraduate program, we teach <strong>the</strong>m <strong>formal</strong> ref<strong>in</strong>ement or<br />

verification <strong>in</strong> one course, depend<strong>in</strong>g on <strong>the</strong> background <strong>of</strong><br />

students <strong>in</strong> <strong>the</strong> class (it is possible to have students <strong>in</strong> <strong>the</strong><br />

class who did not choose <strong>the</strong> above <strong>formal</strong> <strong>methods</strong> classes<br />

dur<strong>in</strong>g <strong>the</strong>ir undergraduate study).<br />

We start <strong>in</strong>troduc<strong>in</strong>g <strong>the</strong> knowledge <strong>of</strong> SOFL process<br />

specification <strong>in</strong> pre- and post-conditions <strong>in</strong> <strong>the</strong> second<br />

semester (one year has two semesters: Spr<strong>in</strong>g and Autumn<br />

semesters) to first-year students. In <strong>the</strong> first semester,<br />

students are required to study programm<strong>in</strong>g language Java.<br />

Although Java is an object-oriented programm<strong>in</strong>g<br />

language, we focus on <strong>the</strong> teach<strong>in</strong>g <strong>of</strong> <strong>the</strong> basic control<br />

structures (e.g., assignment, sequence, selection, and<br />

iteration) ra<strong>the</strong>r than on object-oriented features (e.g.,<br />

classes, <strong>in</strong>heritance). Students are given two to three<br />

programm<strong>in</strong>g problems a week and <strong>the</strong> functional<br />

requirement <strong>of</strong> each problem is written <strong>in</strong> Japanese (nonstructured<br />

Japanese). This study gives students a chance to<br />

build up basic perception <strong>of</strong> programm<strong>in</strong>g and<br />

computation, which will facilitate us to <strong>in</strong>troduce simple<br />

specification techniques <strong>in</strong> <strong>the</strong> second semester. When<br />

teach<strong>in</strong>g <strong>the</strong> concept <strong>of</strong> process specification <strong>in</strong> pre- and<br />

post-conditions, we take a step-by-step approach to start<br />

with simple specifications and <strong>the</strong>n gradually <strong>in</strong>crease <strong>the</strong><br />

degree <strong>of</strong> complication. After a short explanation, students<br />

are required to first digest <strong>the</strong> specification and <strong>the</strong>n<br />

implement it <strong>in</strong> Java, and f<strong>in</strong>ally to test it on <strong>the</strong> basis <strong>of</strong> <strong>the</strong><br />

specification. Surpris<strong>in</strong>gly, we found that most <strong>of</strong> <strong>the</strong><br />

students <strong>in</strong> <strong>the</strong> class can quickly understand <strong>the</strong> concept <strong>of</strong><br />

specification and implement it without problems.<br />

In <strong>the</strong> second year, we <strong>in</strong>troduce more complicated<br />

expressions <strong>in</strong> <strong>the</strong> SOFL process specification language,<br />

such as let-expression, if-<strong>the</strong>n-else expression, and caseexpression,<br />

and <strong>the</strong> composite and set types to improve<br />

expressive power <strong>of</strong> <strong>formal</strong> specification. The same<br />

teach<strong>in</strong>g style used for <strong>the</strong> first-year students is repeated,<br />

but at a more complex level. Our experience shows that<br />

most students can fulfill <strong>the</strong> assigned tasks, except a few <strong>of</strong><br />

students whose ability <strong>in</strong> programm<strong>in</strong>g is low.<br />

In <strong>the</strong> third year, a systematic course <strong>of</strong> approximately<br />

twenty hours on <strong>the</strong> SOFL <strong>formal</strong> eng<strong>in</strong>eer<strong>in</strong>g method is<br />

taught us<strong>in</strong>g <strong>the</strong> techniques described <strong>in</strong> Section 2. Much<br />

more students than those attend<strong>in</strong>g <strong>the</strong> first and second<br />

years' classes attend this class. Students seem to be more<br />

motivated to study this course, because many companies <strong>in</strong><br />

Japan are <strong>in</strong>terested <strong>in</strong> students who have studied new<br />

technologies. Accord<strong>in</strong>g to <strong>the</strong> data so far, an encourag<strong>in</strong>g<br />

news is that almost all <strong>the</strong> students whose performance is<br />

with<strong>in</strong> top 50% <strong>in</strong> this course could get satisfactory jobs <strong>in</strong><br />

well-known companies and almost 100% <strong>of</strong> students who<br />

passed <strong>the</strong> exam<strong>in</strong>ation <strong>of</strong> <strong>the</strong> course could f<strong>in</strong>d satisfactory<br />

jobs <strong>in</strong> <strong>in</strong>dustry.<br />

In <strong>the</strong> forth year, all <strong>of</strong> <strong>the</strong> students who jo<strong>in</strong> SELDS<br />

under <strong>the</strong> first author's supervision will apply <strong>the</strong> SOFL<br />

method <strong>in</strong> model<strong>in</strong>g, <strong>in</strong>spection, and test<strong>in</strong>g <strong>the</strong>ir s<strong>of</strong>tware<br />

systems. Through <strong>the</strong>se projects, students will learn more<br />

experience <strong>of</strong> us<strong>in</strong>g <strong>the</strong> SOFL <strong>formal</strong> notation and<br />

diagrammatic representation known as condition data flow<br />

diagram (CDFD). We usually organize <strong>the</strong> students <strong>in</strong>to<br />

groups so that <strong>the</strong>y will be able to experience how <strong>formal</strong><br />

specifications can help <strong>in</strong> communication, cooperation, and<br />

documentation. All <strong>of</strong> <strong>the</strong> students who have graduated<br />

from SELDS found <strong>the</strong>ir satisfactory jobs as a system or<br />

s<strong>of</strong>tware eng<strong>in</strong>eer <strong>in</strong> large enterprises, such as Sony,<br />

Fujitsu, NEC, CSK, etc. Although we have not heard <strong>of</strong> any<br />

serious case <strong>of</strong> <strong>formal</strong> <strong>methods</strong> be<strong>in</strong>g used <strong>in</strong> those<br />

companies so far, those students who are good at <strong>formal</strong><br />

specification techniques are all work<strong>in</strong>g <strong>in</strong> responsible<br />

positions and play important roles <strong>in</strong> system analysis and<br />

design.<br />

For postgraduate students <strong>in</strong> a master course or a Ph.D<br />

course, we teach <strong>formal</strong> ref<strong>in</strong>ement us<strong>in</strong>g <strong>the</strong> textbook by<br />

Morgan [8] so that <strong>the</strong>y will learn how <strong>formal</strong> <strong>methods</strong> are<br />

expected to use dur<strong>in</strong>g a development process. S<strong>in</strong>ce most<br />

<strong>of</strong> <strong>the</strong> students <strong>in</strong> <strong>the</strong> class <strong>of</strong> this course are not study<strong>in</strong>g<br />

s<strong>of</strong>tware eng<strong>in</strong>eer<strong>in</strong>g but o<strong>the</strong>r subjects, such as animation,<br />

graphics, artificial <strong>in</strong>telligence, network application, <strong>the</strong>y<br />

usually face a difficult time. S<strong>in</strong>ce <strong>the</strong>re is little hope to<br />

apply <strong>the</strong> ref<strong>in</strong>ement calculus <strong>in</strong> practice, students usually<br />

forget specific laws <strong>in</strong> <strong>the</strong> calculus later on but keep <strong>the</strong><br />

fundamental idea <strong>of</strong> ref<strong>in</strong>ement <strong>in</strong> m<strong>in</strong>d. We believe that<br />

<strong>the</strong> fundamental idea will help <strong>the</strong>m make sensible<br />

decisions <strong>in</strong> practical s<strong>of</strong>tware developments.<br />

4. A SUCCESSFUL PROGRAM for TEACHING<br />

FORMAL METHODS to INDUSTRY<br />

Many companies <strong>in</strong> Japan are <strong>the</strong> makers <strong>of</strong> some products,<br />

such as T.V sets, automobiles, tra<strong>in</strong>s, and traffic systems.<br />

To <strong>in</strong>crease functions and reduce <strong>the</strong> cost <strong>in</strong> <strong>the</strong> upgrad<strong>in</strong>g<br />

and ma<strong>in</strong>ta<strong>in</strong><strong>in</strong>g <strong>of</strong> systems, more and more functions are<br />

implemented by s<strong>of</strong>tware. S<strong>in</strong>ce <strong>the</strong> failure <strong>of</strong> s<strong>of</strong>tware <strong>in</strong><br />

such an embedded system is likely to result <strong>in</strong> <strong>the</strong> disability<br />

<strong>of</strong> <strong>the</strong> whole system, caus<strong>in</strong>g <strong>in</strong>convenience, frustration, or<br />

<strong>in</strong>roads — SIGCSE Bullet<strong>in</strong> - 21 - Volume 41, Number 2 — 2009 June

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!