jovanovski / uvasoftwaretesting15 Goto Github PK
View Code? Open in Web Editor NEWGroup FT_1
Group FT_1
Good work on lab 1! The three people who were working on it, get a ++ because of the bonus assignment. (Plus-pluses compensate for possible future minuses and also get you to a higher grade because all plusses do not yield a ten yet).
Some comments:
sumDigits [] = 0
sumDigits (x : xs) = x + sumDigits xs
This works fine, but conceptually what you do is you keep using a plus to go through the list until there's nothing left and then you get a zero. This looks suspiciously like induction and can therefore be represented as a folding higher order function: sumDigits = foldr (+) 0
(also η-reduced). Similarly, your sumOfIntsInList
is also foldr ((+) . sumDigits . toRevDigits) 0
.
The CSI and Euler code uses lots of parenthesis, you don't need most of them. There is also some inconsistency in using backticks: in some cases you seem to be aware of them (when you use elem
as infix) and in other cases not — otherwise you'd know a better way to write (\b -> (says b a))
and \ y -> y >= x
.
There is a library concatenation function called concat
which you can use instead of foldr (++) []
(as it turns out, even Haskell programmers need to concatenate lists all the time). There is also a notElem
thing that is the opposite of elem
(and you mostly use the neg
anyway). Checking a list for being empty is also a library function called null
(so, null xs
is the same as xs == []
).
Keep up the good work! Close the issue when you have no more questions.
Week 5: nicely done, but why the sudden absolute lack of any kind of comments? Usually you were not that curt. I’m especially interested in Ex.2, since it involved a judgement call: what do you think of the result of the refactoring? Did it “improve the design of existing code”? Could you test the properties described in the assignment (extensibility, efficiency, etc)? How?
Week 6: you still use weird constructions like do r <- testFermat k xs; return r
. Don’t give names to pets you do not intend to keep! Just do testFermat k xs
.
Week 6: too bad the bonus doesn’t work with strings, that’s the kind of messages I usually send. Besides that, a nice framework, was very easy to test.
Week 5 is +± (bonus: yes; test reports: no), week 6 is ++.
entails
and equiv
are correct, but could have been done easier by using formula constructors (Impl
and Equiv
, resp.)parseTests
is not really automated. In practice parsers are usually tested by round-tripping: given a correctly formed term, unparsing it (in this case, with show
) and parsing the result should yield the same term.4.1 Is ro(/0) = {/0} or {/0, {/0}}, and is there a difference between
Took me some time to figure out your notation. First of all, ρ (the Greek letter) is different from ℘ (the Weierstrass p). Second, ρ is called “rho”, not “ro”.
Anyway, ℘(∅) is a power set of an empty set. Per definition it is a set, and each element of that set is a subset of ∅. Since ∅ is the smallest possible set, there is nothing beside ∅ that would be its subset. Hence, ℘(∅) is a set with the only element, ∅. Or, ℘(∅)={∅}.
Your implementation of generateSet
piggybacks on the entire QuickCheck. In other words, you do not have two solutions that were asked for.
The use of let
in ex.8 is not really necessary.
Time taken 6h - this was too much time for a bonus exercise to be fun…
Now you know why testing parsers/grammars is hard. Don’t worry, it will get harder for Software Evolution ;)
Week 4 is a ➕➕
tableConvert
could be a foldr
with a function that you either define separately or in place as (\ x -> (++) (show ((ord x) - 55)))
.if isAlphaNum x then checkAN xs else False
. This is just conjunction, right? Write it as such! isAlphaNum x && checkAN xs
is so much easier to read.if bla then True else False
is just the same as bla
.where
or let
clauses to define something like [a b c] = sort [x, y, z]
and use the new variables.fact'
?) but I managed. ++ for you for the second week!A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.