软件工程
文章平均质量分 83
_tianyuxue
这个作者很懒,什么都没留下…
展开
-
Lecture 14: Interface
1 InterfaceJava’s interface is a useful language mechanism for expressing an abstract data type (ADT).1.1 Subtypes A subtype is simply a subset of the supertype : ArrayList and LinkedList are subtype原创 2017-03-28 15:07:11 · 243 阅读 · 0 评论 -
Lecture 1: Static Checking
1 TypesA type is a set of values, along with operations that can be performed on those values. - Java has several primitive types and Object types.2 Static Typingstatically-typed language: The types原创 2017-03-14 15:23:46 · 316 阅读 · 0 评论 -
Lecture 4: Code View
General principles of good code:Don’t Repeat Yourself**(DRY)**Comments Where Needed wirte specificationspecifies the provenance or source of a piece of code that was copied or adapted from elsewher原创 2017-03-14 15:27:25 · 244 阅读 · 0 评论 -
Lecture 3: Testing
Lecture 3: Testing1 ValidationFormal reasoning Code ReviewTesting2 Test-first ProgrammingIn test-first-programming, you write tests before you even write any code. The development of a single funct原创 2017-03-14 15:26:43 · 243 阅读 · 0 评论 -
Lecture 7: Designing Specifications
1 deterministic, declarative and strongdeterministicdeclarative: Does the spec just characterize what the output should be, or does it explicitly say how to compute the output?strong: Does the spec原创 2017-03-14 19:33:40 · 296 阅读 · 0 评论 -
Lecture 8: Avoiding Debugging
1 First Defense: Make Bugs ImpossibleStatic checkingDynamic checkingImmutability Use immutable typeUse immutable reference: use final for declaring the parameters of a method and as many local var原创 2017-03-15 09:17:40 · 237 阅读 · 0 评论 -
Lecture 9: Mutability & Immutability
1 MutabilityMutable : have methods that change the value of the object Immutable : Once created, they always represent the same value.A common use for it is to concatenate a large number of strings t原创 2017-03-15 10:49:26 · 336 阅读 · 0 评论 -
Lecture 10: Recursion
1 RecursionA recursive function is defined in terms of base cases and recursive steps.In a base case, we compute the result immediately given the inputs to the function call.In a recursive step, we c原创 2017-03-16 20:50:55 · 248 阅读 · 0 评论 -
Lecture 25: Map, Filter, Reduce
Reading 25: Map, Filter, Reduce1 Definition of MapReduceMap/Filter/Reduce: A design pattern that substantially simplifies the implementation of functions that operate over sequences of elements. Funct原创 2017-04-07 15:55:37 · 404 阅读 · 0 评论 -
Lecture 12: Abstract Data Types(ADT)
1 What Abstraction MeansHere are some of the names that are used for Abstract Data Types:AbstractionModularityEncapsulationInformation hidingSeparation of concerns1.1 User-Defined TypesThe key i原创 2017-03-23 10:13:06 · 526 阅读 · 0 评论 -
Lecture 11: Debugging - After the System is Deployed
1 Reproduce the BugStart by finding a small, repeatable test case that produces the failure.Once you’ve found a small test case, find and fix the bug using that smaller test case, and then go back to原创 2017-03-23 10:10:50 · 316 阅读 · 0 评论 -
Lecture 24: Graphical User Interface
1 View TreeViews are arranged into a hierarchy of containment, in which some views contain other views. Views are arranged into a hierarchy of containment, in which some views contain other views. 1原创 2017-04-07 15:54:24 · 622 阅读 · 0 评论 -
Lecture 13: Abstraction Functions & Rep Invariants
1 InvariantsThe most important, property of a good abstract data type is that it preserves its own invariantsAn invariant is a property of a program that is always true, for every possible runtime st原创 2017-03-28 15:04:24 · 493 阅读 · 0 评论 -
Lecture 15: Equality
1 Three Ways to Regard EqualityUsing an abstraction function: The function f is Absract Function. To use f as a definition for equality, we would say that a equals b if and only if f(a)=f(b).Using a原创 2017-03-28 22:11:43 · 296 阅读 · 0 评论 -
Lecture 16: Recursive Data Types
1 Recursive Data Types DefinitionA datatype definition:an abstract datatype on the left, defined by its representation (or concrete datatype ) on the right.the representation consists of variants of原创 2017-04-07 15:42:22 · 361 阅读 · 0 评论 -
Lecture 17: Regular Expressions & Grammars
1 GrammarsA grammar defines a set of sentences, where each sentence is a sequence of symbols. For example, our grammar for URLs will specify the set of sentences that are legal URLs in the HTTP protoc原创 2017-04-07 15:43:43 · 361 阅读 · 0 评论 -
Lecture 19: Concurrency
1 The Use of ConcurrencyWeb sites must handle multiple simultaneous users.Mobile apps need to do some of their processing on servers (“in the cloud”).Graphical user interfaces almost always require原创 2017-04-07 15:45:31 · 227 阅读 · 0 评论 -
Lecture 21: Sockets & Networking
1 Client/server design patternA client initiates the communication by connecting to a server.The client sends requests to the server, and the server sends replies back. Finally, the client disconnect原创 2017-04-07 15:47:03 · 244 阅读 · 0 评论 -
Lecture 20: Thread Safety
1 What Threadsafe Means?A data type or static method is threadsafe if it behaves correctly when used from multiple threads, regardless of how those threads are executed, and without demanding additiona原创 2017-04-07 15:49:23 · 593 阅读 · 0 评论 -
Lecture 22: Queues and Message-Passing
1 Message passing with threadsStrategy: Use a synchronized queue for message passing between threads. Java provides the BlockingQueue interface for queues with blocking operations:In an ordinary Queue原创 2017-04-07 15:50:30 · 295 阅读 · 0 评论 -
Lecture 6: Specification
1 Specification1.1 Specification structurespecification of a method consists of several clauses:a precondition , indicated by the keyword requires, is an obligation on the client.a postcondition , in原创 2017-03-14 15:28:19 · 436 阅读 · 0 评论