首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导Software程序语言、讲解Java编程 解析SPSS|解析Java程序
项目预算:
开发周期:
发布时间:
要求地区:
Assessed Coursework
Course Name Object Oriented Software Engineering
Coursework Number 2
Deadline Time: 4:30pm Date: 19
th March 2021
% Contribution to final
course mark
10%
Solo or Group ✓ Solo solo Group
Anticipated Hours
Submission Instructions Submit via Moodle
Please Note: This Coursework cannot be Re-Assessed
Code of Assessment Rules for Coursework Submission
Deadlines for the submission of coursework which is to be formally assessed will be published in course
documentation, and work which is submitted later than the deadline will be subject to penalty as set out below.
The primary grade and secondary band awarded for coursework which is submitted after the published deadline will
be calculated as follows:
(i) in respect of work submitted not more than five working days after the deadline
a. the work will be assessed in the usual way;
b. the primary grade and secondary band so determined will then be reduced by two secondary bands
for each working day (or part of a working day) the work was submitted late.
(ii) work submitted more than five working days after the deadline will be awarded Grade H.
Penalties for late submission of coursework will not be imposed if good cause is established for the late submission.
You should submit documents supporting good cause via MyCampus.
Penalty for non-adherence to Submission Instructions is 2 bands
You must complete an “Own Work” form via https://studentltc.dcs.gla.ac.uk/
for all coursework
Object Oriented Software Engineering
Assessed Exercise 2
Visitors Design Pattern with JavaParser
Objective
In this coursework, you will learn how to use the software framework called JavaParser
and its documentation to build a static analyser. You will also understand how the visitor
design pattern is applied in the implementation of such framework. This objective will be
evaluated based on your ability to extend the VoidVisitorAdapter in JavaParser. This
is to implement concrete detectors that traverses an Abstract Syntax Tree representation
of a program code using the visitors design pattern. [Total Marks: 100, Task 1: 60
marks, Task 2: 30 marks, Deliverable form: 10 marks]
Setup
Create a simple maven project without archtype using eclipse IDE. For Eclipse 2020-12
you can navigate to File, New, Other..., Maven, Maven Project:
1. ❼ Check create a simple project (skip archetype selection).
❼ Enter Group Id = oose.coursework2
❼ Artifact Id= coursework2
❼ Name = coursework2
❼ Click on pom.xml file generated and Include the following dependency:
com.github.javaparser
javaparser-core
3.12.0
2. Create a package called detectors to contain the four java classes for Tasks 1 and
2 highlighted below.
2
Task 1: (60 Marks)
A control flow statement in a method is characterised as a useless control flow when
the control flow continues onto the same place regardless of whether or not the branch is
taken. For example, having an empty statement block for an if statement:
if (argv.length == 1);
System.out.println( argv[0]);
if (argv.length == 0) {
// TODO: handle this case
}
Other forms of control flows should be also considered, namely for, while, do... while
and switch.
Using the visitors design pattern, create the class UselessControlFlowDetector.java
that detects useless control flow in java program code. Create a container class called
Breakpoints.java to collect this observed behaviour as the visit method(s) implemented
in detector transverses through the program structure. Finally, implement the
class Driver.java that instantiates the detector and provides it with program code to
operate on. Driver.java should print each detected pattern to command line in the
format:
Useless Control Flows:
className =?, methodName =?, startline =?, endline =?
className =?, methodName =?, startline =?, endline =?
...
Task 2: (30 Marks)
Recursion is a programming technique of making a function calling itself. Polymorphic
recursion is a property of a program code where the parameter types of a method
may change with each recursive invocation. For example, the methods named method1
in Test.java below implement polymorphic recursion. Here, both recursion and polymorphic
recursion should be detected, independtly of the number of parameters and their
types.
class Test{
int x;
public void method1(String args[]){
method1(args);
3
}
public void method1(String args[],int x, Test t){
this.x =1;
method1(args);
}
}
Using the visitors design pattern, create the class RecursionDetector.java that detects
polymorphic recursion in java program code. Use the container Breakpoints.java
to collect observed recursive behaviour as the visit method(s) implemented in detector
transverses through the program structure. Also extend Driver.java to instantiate
this detector and provide it with program code to operate on. Finally, the output of
Driver.java for detected behaviour should be similar to Task 1, by printing the class
and method name, and also start and end line of observed pattern to command line. in
the format:
Recursions:
className =?, methodName =?, startline =?, endline =?
className =?, methodName =?, startline =?, endline =?
...
Hints
❼ You may need to reference JavaParser’s documentation which is available at: http:
//www.javadoc.io/doc/com.github.javaparser/javaparser-core/3.12.0
❼ You may find the tool AstVisualizer - for visualising Abstract Syntax Trees of java
programs useful for understanding the structure of that matches a desired behaviour.
This tool can be downloaded from OOSE Moodle webpage.
❼ Finally, we will use Calculator.java that is available on Moodle to test your
solutions. For example, we may refactor Calculator.java to introduce recursion
or change the control flow to match a desired pattern. We assume there are no
nested classes.
❼ We will also check the clarity of your solution, documentation and the extent it
satisfies the SOLID software design principles.
Deliverables
Submission should be made electronically via Moodle for Assessed Coursework 2.
4
1. Attach your zipped maven project with your solutions to Task1 and Task2. State
your name and registration number at the top of UselessControlFlowDetector.java,
RecursionDetector.java, Breakpoints.java and Driver.java.
2. A runnable jar file of your project that is able to be executed from command line
with the file path and name passed as argument (10 marks). For example:
java -jar coursework2.jar ”C:\...\calculator.java”
Assessment
Submission is due by 16:30 on 19th March 2021. You should submit your solution
through the class Moodle page.
Tutors and demonstrators will be in your allocated Lab to offer assistance. You should
endeavour to attend each lab so you can get the necessary help.
As per the Code of Assessment policy regarding late submissions, submissions will
be accepted for up to 5 working days beyond the due date. Any late submissions will
be marked as if submitted on time, but reduced by 2 marks for each additional day.
Submissions received more than 5 working days after the due date will receive an H (band
value of 0).
Dr Fani Deligianni (fani.deligianni@glasgow.ac.uk), 321b Sir Alwyn Williams Building, School of
Computing Science, University of Glasgow
5
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!