My Ads

Rabu, 22 April 2009

progress

ruti - agi research
progress report march - may 2005

focus from development lingu for march month up to may prototype transition lingu with java to prototype lingu with hol. this prototype is supposed has caned to do verification from script lingu and then do validation towards database environment actually. for this development, working is divided to be 3 parts that is verification part linguhol, lingu-java engine, and database test generator.

verification linguhol

this part does verification from script lingu by using hol theorem prover. this verification development has been done above engine linux that install hol and mosml.

script lingu that made script based on case study set with 7 critical modules. module:
- answer evaluation function
- identity filter function is not identified (unknown identity filter)
- identity duplication filter function (double identity filter)
- evaluation result answer validity cheque function (safeness check)
- evaluation result justice cheque function (fairness check)
- cheque function completions answer (completeness check)
- nomenclature consistency cheque function (name consistency check)

entire functions on success made as lingu script, complete with spesification and the verification. for example, one of [the] function that success made script lingu- identity filter function unrecognize (unknown). this function is used to mem-filter answer sheet the owner identity is not identified. script-:

val filter_unknown_def = define `filter_unknown (submittab: answerformtable set, mastertab: registrationtable set, unknownaformtab: answerformtable set) (dummy) = let ids = select submittab (\r. r. id) (\r. t) in let okids = select mastertab (\r. r. id) (\r. exists ids (\id. id = r. id) in (delete submittab (\r. exists okids(\t. t = r. id) >> qinsert submittab i (am \r. t) unknownaformtab) `;

so that verification can be done as according to rule hoare logic, so need a set spesification that describe precondition and postcondition supposed from function execution result. entire spesifications from critical module on made. for example spesification from filter unknown on:

val spec_unk = --`spec ((pre: ) unknownaformtab = {}, (script: ) filter_unknown(submittab, mastertab, unknownaformtab) (dummy), (post: ) forall unknownaformtab (\r. " (exists mastertab (\r. r. id = r. id)`--;

after entire spesifications has been defined, verification process then begun by using hol theorem prover. next script verification that used to investigate filter function unknown.

val cert_unk = certify (spec_unk, normalize_tac [i_thm then prove_tac [);

entire script from critical functions on solvable by using this theory. result from this verification although not yet approach case study truthfully but mte can be made measuring rod about prototype ability lingu in do verification from a real case.

this prototype overall development, from verification stage up to validation stage at level database has been made a paper with title “lingusql: a transformation and verification tool for database application” and sent to computer science national seminar and indonesia technology (snikti) year 2005.

lingu-java engine

this module part that on execution lingu from beginning until validation finished on platform java. this module is divided to be 3 that is lingu2java translator, lingu-java interpreter, and lingu front-end.




lingu2java translator
lingu2java translator be a program that change data type definition and class lingu be class in language java. in this time lingu2java translator get data type definition with 2 kinds keyword, that is record and dbase. keyword dbase used to define a database, tables name containing in database and table type concerned. while to define table in database used keyword record, column names containing and the type. in this time there's only 3 column types, that is integer for round number, string for sentence, and date for date information. each table definition and database will translated to be a class in language java, where class has field as according to the definition in lingu (column names to record, and table names to dbase), along with method accessor and mutator.

to class that defined in lingu (marked with keyword class) will translated to be a class in language java with parameter from constructor parameter from class in lingu. this parameter also made field from class, next a field addition, that is dbmanager, a class that used by lingu2java translator to translate database operation in lingu be database operation truthfully with sql use connection jdbc that determined. in this time database operation in lingu that translatable new operation insertall and delete, while another database operation soon will follow after troubleshoot local variable with in-place type definition be solved.

java-lingu interpreter
java-lingu interpreter be a program that execute validation script from a script lingu along with scenario exist in depth. java-lingu interpreter make use output from lingu2java translator shaped class in language java to execute method that called in a validation script. interpreter this also can do simple database operation like to look for in a what found data such as those which desirable by user, in lingu expressed with keyword find.


lingu frontend
lingu frontend a program that make possible somebody to execute a script lingu along with scenario existing mendalamnya pass a interface based on gui. interface that used able display everything validation script that executed next output the execution result. lingu frontend self make use java-lingu interpreter to execute script lingu desirable by user.





database test generator

insides database module development test this generator is found several important stages that is:
1. election dbms (database management system) that up to standard.
2. connection maker and functions basis for manipulate data.
3. maker a function to fill database with datas dummy randomly.
4. arrangement script validation from program lingu.

in this time this module working process come up with task to four that is maker script validation.

follow to be example from script validation. example script this is good for memvalidasi one of [the] sub module from set(student entrance test) that is sub module checkunknown. sub module checkunknown good for check to what found answer sheet with id not registered.

script this validation is written by using language java. mendalamnya found two important functions that is: initialization, insert, and testing. initialization function good for make connection to data base and take datas that need from data base. function insert good for add data, while function testing good for do valdasi.


import java. sql. ; import java. filch. vector; class val_unknown { / constructor, initialization stage public val_unknown (string host, int port, string db, string sch, string user, string passwd) { / initialization object dbgenerator gene = new dbgenerator(host, port, db, sch, user, passwd); f_register = gene. getfields(db, sch, " register" ); f_answer = gene. getfields(db, sch, " answer" ); } public void insert_register(string id){ string sql =" " ; / create sql u/ fill data try { int aa = gene. mg. insert(sql); } catch (sqlexception sqle) { system. out. println(" fail to put into data" ); } } public void testing(){ vector id_answer = new vector(); vector id_register = new vector(); vector unknown = new vector(); boolean flag = true; / take field id from table answer => ids string query =" select id from answer" ; try { resultset rsanswer = gene. mg. select(query); while(rsanswer. next() id_answer. add(rsanswer. getobject(1); } catch (sqlexception sqle) { } / take field id from table register yg id- appropriate / dgn id answer => oids query =" select id from register where answer. id = register. id" ; try { resultset rsregister = gene. mg. select(query); while(rsregister. next() { id_register. add(rsregister. getobject(1); } } catch (sqlexception sqle) { } / delete from ids ids. id = oids. id for(int ii=0; ii


programming concept

chapter iv programming concept berorientasi object


to get of best of programming java, must understand well concept
programming berorientasi object, because java be language programming
berorientasi object. in part this be discussed important concepts in
programming berorientasi object, so that supposed we more easy in
study language java.


a.


object




in base it all thing there at world real can be assumed






























b.
as a object. if look at more advanced, in base it there two
prima facie characteristics in a object, that is:

every object has attribute as status then
called as state.
every object has behavior will sold out then be called
as behaviour.
the simple example: bike object
has attribute (state): pedal, wheel, bar, and colour.

has behavior sold out (behaviour): ascending the speed,
the speed decreaseds, and bike tooth transfer.
in development ware soft berorientasi object, object
in ware soft will keep state- in variable and
keep behaviour information (behaviour) in method or
functions/procedure.


class
class differ with object. class be prototype
define variables and method according to general.
while object in other side is instansiasi from a class.
practice 10. class. java
class book {
string writer;
string title;
void isi(string isi1, string isi2) {
title = isi1;
writer = isi2;
}



25































































c.








void cetakkelayar() {
if(judul==null & pengarang==null) return;
system. out. println(" title: " + title +
" , writer: " + writer);
}
}


class essay {
public static void main(string[ args) {
book a, b, c, d;
a = b = c = d = new buku();
a. isi(" programming java" , " asep herman suyanto" );
a. cetakkelayar();
b. isi(null, null);
b. cetakkelayar();
c. isi(null, " champion prasetyo hendriyanto" );
c. cetakkelayar();
d. isi(" web programming" , null);
d. cetakkelayar();
}
}













enkapsulasi
in a object that contain variables and method-
method, can be determined right access in a variable or method from
object. variable enfolding and method in a object in part
protected here's called with enkapsulasi. so, enkapsulasi
can be interpretted as parcel (wrapper) patron program and data
being cultivated. this wrapper defines behaviour and protect
program and data being cultivated so that not being accessinged just any by
program other.





26

























d.








benefit from process enkapsulasi:
modularitas
source code from a object can be managed independently from
other object source code.

information hiding
because we can determine access right a variable/method from
object, with such we can hide information
unnecessary known object other.


inheritance
class can be defined with reference in class other
definition. inheritance be inheritance attribute and method in
a class got from class definition. every
subclass will inherit state (variables) and behaviour (method-
method) from superclass-. subclass then can add state
and behaviour new specific and can also modify (override)
state and behaviour that demoted by superclass-.


profit from inheritance:
subclass prepare state/behaviour specific
distinguish it with superclass, this matter will make
programmer java to use repeat source code from
superclass that there.

programmer java can define superclass special
has generik, called abstract class, to define
class with behaviour and state in general.


term in inheritance necessary payed:

extends
keyword this must we add in definition class be
subclass.

superclass
superclass used to show hierarchy class mean
class base from subclass/class child.
subclass
subclass class child or descendant according to hierarchy from superclass.





27








super
keyword this is used to call engine-builder from superclass
or be variable that threaten in superclass.
methode overriding
pendefinisian repeat method same in subclass.


in inheritance, method overriding differ with method
overloading. if method overriding define return
method same, good name method also signature or parameter
need in subclass, if method overloading define
method that has name same, but with signature different
in definition class same.
practice 11. inheritance. java
class a {
int x;
int y;
void tampilkannilaixy() {
system. out. println(" value x: " + x +" , y: " + y);
}
}


class b extends a {
int z;
void tampilkanjumlah() {
/subclass can accessing member from superclass
system. out. println(" total: " + (x+y+z);
}
}


class inheritance {
public static void main(string[ args) {
a varsuperob = new a();
b varsubob = new b();
system. out. println(" superclass" );
varsuperob. x = 10;
varsuperob. y = 20;
varsuperob. tampilkannilaixy();




28












system. out. println(" subclass" );
/member superclass can be accessinged from subclass he
varsubob. x = 5;
varsubob. y = 4;
varsubob. tampilkannilaixy();


system. out. println(" subclass total" );
/member addition there's only in subclass
varsubob. z = 30;
varsubob. tampilkanjumlah();


system. out. println(" subclass" );
varsubob. x = 15;
varsubob. y = 14;
varsubob. tampilkannilaixy();


system. out. println(" superclass" );
varsuperob. x = 10;
varsuperob. y = 20;
/super. x = 100; error
/super. y = 200; error
varsuperob. tampilkannilaixy();


system. out. println(" subclass total" );
varsubob. z = 60;
varsubob. tampilkanjumlah();
}
}