document_title: Test-driven development

question_text: when should the developer test cases be written

question_tokens: when should the developer test cases be written

text: Test-driven development

text: Test-driven development cycle[edit]

text: The following sequence is based on the book Test-Driven Development by Example.[2]

text: In test-driven development, each new feature begins with writing a test. Write a test that defines a function or improvements of a function, which should be very succinct. To write a test, the developer must clearly understand the feature's specification and requirements. The developer can accomplish this through use cases and user stories to cover the requirements and exception conditions, and can write the test in whatever testing framework is appropriate to the software environment. It could be a modified version of an existing test. This is a differentiating feature of test-driven development versus writing unit tests after the code is written: it makes the developer focus on the requirements before writing the code, a subtle but important difference.

text: This validates that the test harness is working correctly, shows that the new test does not pass without requiring new code because the required behavior already exists, and it rules out the possibility that the new test is flawed and will always pass. The new test should fail for the expected reason. This step increases the developer's confidence in the new test.

text: The next step is to write some code that causes the test to pass. The new code written at this stage is not perfect and may, for example, pass the test in an inelegant way. That is acceptable because it will be improved and honed in Step 5.

text: At this point, the only purpose of the written code is to pass the test. The programmer must not write code that is beyond the functionality that the test checks.

text: If all test cases now pass, the programmer can be confident that the new code meets the test requirements, and does not break or degrade any existing features. If they do not, the new code must be adjusted until they do.

text: The growing code base must be cleaned up regularly during test-driven development. New code can be moved from where it was convenient for passing a test to where it more logically belongs. Duplication must be removed. Object, class, module, variable and method names should clearly represent their current purpose and use, as extra functionality is added. As features are added, method bodies can get longer and other objects larger. They benefit from being split and their parts carefully named to improve readability and maintainability, which will be increasingly valuable later in the software lifecycle. Inheritance hierarchies may be rearranged to be more logical and helpful, and perhaps to benefit from recognized design patterns. There are specific and general guidelines for refactoring and for creating clean code.[6][7] By continually re-running the test cases throughout each refactoring phase, the developer can be confident that process is not altering any existing functionality.

text: The concept of removing duplication is an important aspect of any software design. In this case, however, it also applies to the removal of any duplication between the test code and the production code—for example magic numbers or strings repeated in both to make the test pass in Step 3.

text: Starting with another new test, the cycle is then repeated to push forward the functionality. The size of the steps should always be small, with as few as 1 to 10 edits between each test run. If new code does not rapidly satisfy a new test, or other tests fail unexpectedly, the programmer should undo or revert in preference to excessive debugging. Continuous integration helps by providing revertible checkpoints. When using external libraries it is important not to make increments that are so small as to be effectively merely testing the library itself,[4] unless there is some reason to believe that the library is buggy or is not sufficiently feature-complete to serve all the needs of the software under development.

text: Development style[edit]

text: There are various aspects to using test-driven development, for example the principles of "keep it simple, stupid" (KISS) and "You aren't gonna need it" (YAGNI). By focusing on writing only the code necessary to pass tests, designs can often be cleaner and clearer than is achieved by other methods.[2] In Test-Driven Development by Example, Kent Beck also suggests the principle "Fake it till you make it".

text: To achieve some advanced design concept such as a design pattern, tests are written that generate that design. The code may remain simpler than the target pattern, but still pass all required tests. This can be unsettling at first but it allows the developer to focus only on what is important.

text: Writing the tests first: The tests should be written before the functionality that is to be tested. This has been claimed to have many benefits. It helps ensure that the application is written for testability, as the developers must consider how to test the application from the outset rather than adding it later. It also ensures that tests for every feature get written. Additionally, writing the tests first leads to a deeper and earlier understanding of the product requirements, ensures the effectiveness of the test code, and maintains a continual focus on software quality.[8] When writing feature-first code, there is a tendency by developers and organisations to push the developer on to the next feature, even neglecting testing entirely. The first TDD test might not even compile at first, because the classes and methods it requires may not yet exist. Nevertheless, that first test functions as the beginning of an executable specification.[9]

text: Each test case fails initially: This ensures that the test really works and can catch an error. Once this is shown, the underlying functionality can be implemented. This has led to the "test-driven development mantra", which is "red/green/refactor", where red means fail and green means pass. Test-driven development constantly repeats the steps of adding test cases that fail, passing them, and refactoring. Receiving the expected test results at each stage reinforces the developer's mental model of the code, boosts confidence and increases productivity.

text: Keep the unit small[edit]

text: For TDD, a unit is most commonly defined as a class, or a group of related functions often called a module. Keeping units relatively small is claimed to provide critical benefits, including:

text:
Reduced debugging effort – When test failures are detected, having smaller units aids in tracking down errors.
Self-documenting tests – Small test cases are easier to read and to understand.[8]

text: Advanced practices of test-driven development can lead to acceptance test–driven development (ATDD) and Specification by example where the criteria specified by the customer are automated into acceptance tests, which then drive the traditional unit test-driven development (UTDD) process.[10] This process ensures the customer has an automated mechanism to decide whether the software meets their requirements. With ATDD, the development team now has a specific target to satisfy – the acceptance tests – which keeps them continuously focused on what the customer really wants from each user story.

text: Best practices[edit]

text: Test structure[edit]

text: Effective layout of a test case ensures all required actions are completed, improves the readability of the test case, and smooths the flow of execution. Consistent structure helps in building a self-documenting test case. A commonly applied structure for test cases has (1) setup, (2) execution, (3) validation, and (4) cleanup.

text:
Setup: Put the Unit Under Test (UUT) or the overall test system in the state needed to run the test.
Execution: Trigger/drive the UUT to perform the target behavior and capture all output, such as return values and output parameters. This step is usually very simple.
Validation: Ensure the results of the test are correct. These results may include explicit outputs captured during execution or state changes in the UUT.
Cleanup: Restore the UUT or the overall test system to the pre-test state. This restoration permits another test to execute immediately after this one.[8]

text: Individual best practices[edit]

text: This section contains instructions, advice, or how-to content. The purpose of Wikipedia is to present facts, not to train. Please help improve this article either by rewriting the how-to content or by moving it to Wikiversity, Wikibooks or Wikivoyage. (May 2014)

tag: table

text: This section is in a list format that may be better presented using prose. You can help by converting this section to prose, if appropriate. Editing help is available. (May 2014)

text: Individual best practices states that one should:

text:
Separate common set-up and teardown logic into test support services utilized by the appropriate test cases.
Keep each test oracle focused on only the results necessary to validate its test.
Design time-related tests to allow tolerance for execution in non-real time operating systems. The common practice of allowing a 5-10 percent margin for late execution reduces the potential number of false negatives in test execution.
Treat your test code with the same respect as your production code. It also must work correctly for both positive and negative cases, last a long time, and be readable and maintainable.
Get together with your team and review your tests and test practices to share effective techniques and catch bad habits. It may be helpful to review this section during your discussion.[11]

text: Practices to avoid, or "anti-patterns"[edit]

text:
Having test cases depend on system state manipulated from previously executed test cases (i.e., you should always start a unit test from a known and pre-configured state).
Dependencies between test cases. A test suite where test cases are dependent upon each other is brittle and complex. Execution order should not be presumed. Basic refactoring of the initial test cases or structure of the UUT causes a spiral of increasingly pervasive impacts in associated tests.
Interdependent tests. Interdependent tests can cause cascading false negatives. A failure in an early test case breaks a later test case even if no actual fault exists in the UUT, increasing defect analysis and debug efforts.
Testing precise execution behavior timing or performance.
Building “all-knowing oracles.” An oracle that inspects more than necessary is more expensive and brittle over time. This very common error is dangerous because it causes a subtle but pervasive time sink across the complex project.[11]
Testing implementation details.
Slow running tests.

text: Benefits[edit]

text: A 2005 study found that using TDD meant writing more tests and, in turn, programmers who wrote more tests tended to be more productive.[12] Hypotheses relating to code quality and a more direct correlation between TDD and productivity were inconclusive.[13]

text: Programmers using pure TDD on new ("greenfield") projects reported they only rarely felt the need to invoke a debugger. Used in conjunction with a version control system, when tests fail unexpectedly, reverting the code to the last version that passed all tests may often be more productive than debugging.[14]

text: Test-driven development offers more than just simple validation of correctness, but can also drive the design of a program.[15] By focusing on the test cases first, one must imagine how the functionality is used by clients (in the first case, the test cases). So, the programmer is concerned with the interface before the implementation. This benefit is complementary to design by contract as it approaches code through test cases rather than through mathematical assertions or preconceptions.

text: Test-driven development offers the ability to take small steps when required. It allows a programmer to focus on the task at hand as the first goal is to make the test pass. Exceptional cases and error handling are not considered initially, and tests to create these extraneous circumstances are implemented separately. Test-driven development ensures in this way that all written code is covered by at least one test. This gives the programming team, and subsequent users, a greater level of confidence in the code.

text: While it is true that more code is required with TDD than without TDD because of the unit test code, the total code implementation time could be shorter based on a model by Müller and Padberg.[16] Large numbers of tests help to limit the number of defects in the code. The early and frequent nature of the testing helps to catch defects early in the development cycle, preventing them from becoming endemic and expensive problems. Eliminating defects early in the process usually avoids lengthy and tedious debugging later in the project.

text: TDD can lead to more modularized, flexible, and extensible code. This effect often comes about because the methodology requires that the developers think of the software in terms of small units that can be written and tested independently and integrated together later. This leads to smaller, more focused classes, looser coupling, and cleaner interfaces. The use of the mock object design pattern also contributes to the overall modularization of the code because this pattern requires that the code be written so that modules can be switched easily between mock versions for unit testing and "real" versions for deployment.

text: Because no more code is written than necessary to pass a failing test case, automated tests tend to cover every code path. For example, for a TDD developer to add an else branch to an existing if statement, the developer would first have to write a failing test case that motivates the branch. As a result, the automated tests resulting from TDD tend to be very thorough: they detect any unexpected changes in the code's behaviour. This detects problems that can arise where a change later in the development cycle unexpectedly alters other functionality.

text: Madeyski[17] provided an empirical evidence (via a series of laboratory experiments with over 200 developers) regarding the superiority of the TDD practice over the traditional Test-Last approach or testing for correctness approach, with respect to the lower coupling between objects (CBO). The mean effect size represents a medium (but close to large) effect on the basis of meta-analysis of the performed experiments which is a substantial finding. It suggests a better modularization (i.e., a more modular design), easier reuse and testing of the developed software products due to the TDD programming practice.[17] Madeyski also measured the effect of the TDD practice on unit tests using branch coverage (BC) and mutation score indicator (MSI),[18][19][20] which are indicators of the thoroughness and the fault detection effectiveness of unit tests, respectively. The effect size of TDD on branch coverage was medium in size and therefore is considered substantive effect.[17]

text: Limitations[edit]

text: This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (August 2013) (Learn how and when to remove this template message)

text: Test-driven development does not perform sufficient testing in situations where full functional tests are required to determine success or failure, due to extensive use of unit tests.[21] Examples of these are user interfaces, programs that work with databases, and some that depend on specific network configurations. TDD encourages developers to put the minimum amount of code into such modules and to maximize the logic that is in testable library code, using fakes and mocks to represent the outside world.[22]

text: Management support is essential. Without the entire organization believing that test-driven development is going to improve the product, management may feel that time spent writing tests is wasted.[23]

text: Unit tests created in a test-driven development environment are typically created by the developer who is writing the code being tested. Therefore, the tests may share blind spots with the code: if, for example, a developer does not realize that certain input parameters must be checked, most likely neither the test nor the code will verify those parameters. Another example: if the developer misinterprets the requirements for the module he is developing, the code and the unit tests he writes will both be wrong in the same way. Therefore, the tests will pass, giving a false sense of correctness.

text: A high number of passing unit tests may bring a false sense of security, resulting in fewer additional software testing activities, such as integration testing and compliance testing.

text: Tests become part of the maintenance overhead of a project. Badly written tests, for example ones that include hard-coded error strings or are themselves prone to failure, are expensive to maintain. This is especially the case with fragile tests.[24] There is a risk that tests that regularly generate false failures will be ignored, so that when a real failure occurs, it may not be detected. It is possible to write tests for low and easy maintenance, for example by the reuse of error strings, and this should be a goal during the code refactoring phase described above.

text: Writing and maintaining an excessive number of tests costs time. Also, more-flexible modules (with limited tests) might accept new requirements without the need for changing the tests. For those reasons, testing for only extreme conditions, or a small sample of data, can be easier to adjust than a set of highly detailed tests.

text: The level of coverage and testing detail achieved during repeated TDD cycles cannot easily be re-created at a later date. Therefore these original, or early, tests become increasingly precious as time goes by. The tactic is to fix it early. Also, if a poor architecture, a poor design, or a poor testing strategy leads to a late change that makes dozens of existing tests fail, then it is important that they are individually fixed. Merely deleting, disabling or rashly altering them can lead to undetectable holes in the test coverage.

text: Test-driven work[edit]

text: Test-driven development has been adopted outside of software development, in both product and service teams, as test-driven work.[25] Similar to TDD, non-software teams develop quality control (QC) checks (usually manual tests rather than automated tests) for each aspect of the work prior to commencing. These QC checks are then used to inform the design and validate the associated outcomes. The six steps of the TDD sequence are applied with minor semantic changes:

text:
"Add a check" replaces "Add a test"
"Run all checks" replaces "Run all tests"
"Do the work" replaces "Write some code"
"Run all checks" replaces "Run tests"
"Clean up the work" replaces "Refactor code"
"Repeat"

tag: ol

text: TDD and ATDD[edit]

text: Test-driven development is related to, but different from acceptance test–driven development (ATDD).[26] TDD is primarily a developer’s tool to help create well-written unit of code (function, class, or module) that correctly performs a set of operations. ATDD is a communication tool between the customer, developer, and tester to ensure that the requirements are well-defined. TDD requires test automation. ATDD does not, although automation helps with regression testing. Tests used in TDD can often be derived from ATDD tests, since the code units implement some portion of a requirement. ATDD tests should be readable by the customer. TDD tests do not need to be.

text: TDD and BDD[edit]

text: BDD (behavior-driven development) combines practices from TDD and from ATDD.[27] It includes the practice of writing tests first, but focuses on tests which describe behavior, rather than tests which test a unit of implementation. Tools such as Mspec and Specflow provide a syntax which allow non-programmers to define the behaviors which developers can then translate into automated tests.

text: Code visibility[edit]

text: Test suite code clearly has to be able to access the code it is testing. On the other hand, normal design criteria such as information hiding, encapsulation and the separation of concerns should not be compromised. Therefore unit test code for TDD is usually written within the same project or module as the code being tested.

text: In object oriented design this still does not provide access to private data and methods. Therefore, extra work may be necessary for unit tests. In Java and other languages, a developer can use reflection to access private fields and methods.[28] Alternatively, an inner class can be used to hold the unit tests so they have visibility of the enclosing class's members and attributes. In the .NET Framework and some other programming languages, partial classes may be used to expose private methods and data for the tests to access.

text: It is important that such testing hacks do not remain in the production code. In C and other languages, compiler directives such as #if DEBUG ... #endif can be placed around such additional classes and indeed all other test-related code to prevent them being compiled into the released code. This means the released code is not exactly the same as what was unit tested. The regular running of fewer but more comprehensive, end-to-end, integration tests on the final release build can ensure (among other things) that no production code exists that subtly relies on aspects of the test harness.

text: There is some debate among practitioners of TDD, documented in their blogs and other writings, as to whether it is wise to test private methods and data anyway. Some argue that private members are a mere implementation detail that may change, and should be allowed to do so without breaking numbers of tests. Thus it should be sufficient to test any class through its public interface or through its subclass interface, which some languages call the "protected" interface.[29] Others say that crucial aspects of functionality may be implemented in private methods and testing them directly offers advantage of smaller and more direct unit tests.[30][31]

text: Software for TDD[edit]

text: There are many testing frameworks and tools that are useful in TDD.

text: xUnit frameworks[edit]

text: Developers may use computer-assisted testing frameworks, such as xUnit created in 1998, to create and automatically run the test cases. Xunit frameworks provide assertion-style test validation capabilities and result reporting. These capabilities are critical for automation as they move the burden of execution validation from an independent post-processing activity to one that is included in the test execution. The execution framework provided by these test frameworks allows for the automatic execution of all system test cases or various subsets along with other features.[32]

text: TAP results[edit]

text: Testing frameworks may accept unit test output in the language-agnostic Test Anything Protocol created in 1987.

text: Fakes, mocks and integration tests[edit]

text: Unit tests are so named because they each test one unit of code. A complex module may have a thousand unit tests and a simple module may have only ten. The unit tests used for TDD should never cross process boundaries in a program, let alone network connections. Doing so introduces delays that make tests run slowly and discourage developers from running the whole suite. Introducing dependencies on external modules or data also turns unit tests into integration tests. If one module misbehaves in a chain of interrelated modules, it is not so immediately clear where to look for the cause of the failure.

text: When code under development relies on a database, a web service, or any other external process or service, enforcing a unit-testable separation is also an opportunity and a driving force to design more modular, more testable and more reusable code.[33] Two steps are necessary:

text:
Whenever external access is needed in the final design, an interface should be defined that describes the access available. See the dependency inversion principle for a discussion of the benefits of doing this regardless of TDD.
The interface should be implemented in two ways, one of which really accesses the external process, and the other of which is a fake or mock. Fake objects need do little more than add a message such as “Person object saved” to a trace log, against which a test assertion can be run to verify correct behaviour. Mock objects differ in that they themselves contain test assertions that can make the test fail, for example, if the person's name and other data are not as expected.

text: Fake and mock object methods that return data, ostensibly from a data store or user, can help the test process by always returning the same, realistic data that tests can rely upon. They can also be set into predefined fault modes so that error-handling routines can be developed and reliably tested. In a fault mode, a method may return an invalid, incomplete or null response, or may throw an exception. Fake services other than data stores may also be useful in TDD: A fake encryption service may not, in fact, encrypt the data passed; a fake random number service may always return 1. Fake or mock implementations are examples of dependency injection.

text: A Test Double is a test-specific capability that substitutes for a system capability, typically a class or function, that the UUT depends on. There are two times at which test doubles can be introduced into a system: link and execution. Link time substitution is when the test double is compiled into the load module, which is executed to validate testing. This approach is typically used when running in an environment other than the target environment that requires doubles for the hardware level code for compilation. The alternative to linker substitution is run-time substitution in which the real functionality is replaced during the execution of a test case. This substitution is typically done through the reassignment of known function pointers or object replacement.

text: Test doubles are of a number of different types and varying complexities:

text:
Dummy – A dummy is the simplest form of a test double. It facilitates linker time substitution by providing a default return value where required.
Stub – A stub adds simplistic logic to a dummy, providing different outputs.
Spy – A spy captures and makes available parameter and state information, publishing accessors to test code for private information allowing for more advanced state validation.
Mock – A mock is specified by an individual test case to validate test-specific behavior, checking parameter values and call sequencing.
Simulator – A simulator is a comprehensive component providing a higher-fidelity approximation of the target capability (the thing being doubled). A simulator typically requires significant additional development effort.[8]

text: A corollary of such dependency injection is that the actual database or other external-access code is never tested by the TDD process itself. To avoid errors that may arise from this, other tests are needed that instantiate the test-driven code with the "real" implementations of the interfaces discussed above. These are integration tests and are quite separate from the TDD unit tests. There are fewer of them, and they must be run less often than the unit tests. They can nonetheless be implemented using the same testing framework, such as xUnit.

text: Integration tests that alter any persistent store or database should always be designed carefully with consideration of the initial and final state of the files or database, even if any test fails. This is often achieved using some combination of the following techniques:

text:
The TearDown method, which is integral to many test frameworks.
try...catch...finally exception handling structures where available.
Database transactions where a transaction atomically includes perhaps a write, a read and a matching delete operation.
Taking a "snapshot" of the database before running any tests and rolling back to the snapshot after each test run. This may be automated using a framework such as Ant or NAnt or a continuous integration system such as CruiseControl.
Initialising the database to a clean state before tests, rather than cleaning up after them. This may be relevant where cleaning up may make it difficult to diagnose test failures by deleting the final state of the database before detailed diagnosis can be performed.

text: TDD for complex systems[edit]

text: Exercising TDD on large, challenging systems requires a modular architecture, well-defined components with published interfaces, and disciplined system layering with maximization of platform independence. These proven practices yield increased testability and facilitate the application of build and test automation.[8]

text: Designing for testability[edit]

text: Complex systems require an architecture that meets a range of requirements. A key subset of these requirements includes support for the complete and effective testing of the system. Effective modular design yields components that share traits essential for effective TDD.

text:
High Cohesion ensures each unit provides a set of related capabilities and makes the tests of those capabilities easier to maintain.
Low Coupling allows each unit to be effectively tested in isolation.
Published Interfaces restrict Component access and serve as contact points for tests, facilitating test creation and ensuring the highest fidelity between test and production unit configuration.

text: A key technique for building effective modular architecture is Scenario Modeling where a set of sequence charts is constructed, each one focusing on a single system-level execution scenario. The Scenario Model provides an excellent vehicle for creating the strategy of interactions between components in response to a specific stimulus. Each of these Scenario Models serves as a rich set of requirements for the services or functions that a component must provide, and it also dictates the order that these components and services interact together. Scenario modeling can greatly facilitate the construction of TDD tests for a complex system.[8]

text: Managing tests for large teams[edit]

text: In a larger system the impact of poor component quality is magnified by the complexity of interactions. This magnification makes the benefits of TDD accrue even faster in the context of larger projects. However, the complexity of the total population of tests can become a problem in itself, eroding potential gains. It sounds simple, but a key initial step is to recognize that test code is also important software and should be produced and maintained with the same rigor as the production code.

text: Creating and managing the architecture of test software within a complex system is just as important as the core product architecture. Test drivers interact with the UUT, test doubles and the unit test framework.[8]


document_title: Template:Location map USA Los Angeles Metropolitan Area

question_text: where is los angeles in the usa map

question_tokens: where is los angeles in the usa map

root

text:
Location map of the Los Angeles metropolitan area

name
the Los Angeles metropolitan area

border
coordinates

34.86

-119.10
←↕→
-117.30

33.28

map center
34°04′N 118°12′W / 34.07°N 118.2°W / 34.07; -118.2

image
USA Los Angeles Metropolitan Area location map.svg

text: California location map templates

tag: ul

text: Wikipedia semi-protected templates


document_title: Legends of Tomorrow (season 2)

question_text: dc's legends of tomorrow season 2 episode 1

question_tokens: dc 's legends of tomorrow season 2 episode 1

text: Legends of Tomorrow (season 2)

text: Episodes[edit]

text:
No.overallNo. inseasonTitleDirected byWritten byOriginal air dateProd.codeU.S. viewers(millions)171"Out of Time"Dermott DownsStory by : Greg Berlanti & Chris Fedak Teleplay by : Marc Guggenheim & Phil KlemmerOctober 13, 2016 (2016-10-13)T13.200011.82[1]
In 2016, historian Nate Heywood enlists Mayor Oliver Queen's help in locating the Waverider after it was caught in a nuclear blast in 1942. The pair find the ship in an ocean with only Mick aboard in stasis, who tells them what happened after being revived. Rip's team—Mick, Ray, Sara, Jax, and Martin—traveled through time dealing with "aberrations" in history. They learned that a nuclear bomb would be detonated in New York City in 1942. The team discovered Damien Darhk, working with the Nazis, was behind the attack. Sara attempted to kill Darhk to prevent Laurel's death, but Darhk escaped and launched his sole atomic bomb toward New York from a U-boat. Rip chose to scatter the team throughout time, except for the injured Mick, to save their lives while he intercepted the bomb with the Waverider and saved New York. In the present, Mick and Nate use the Waverider to travel through time and rescue everyone, but fail to find any trace of Rip. After fixing events in 1942 to prevent the Nazis from making a nuclear bomb, the team is confronted by the Justice Society of America (JSA). Meanwhile, Darhk is shown to be working with Eobard Thawne.
182"The Justice Society of America"Michael GrossmanChris Fedak & Sarah Nicole JonesOctober 20, 2016 (2016-10-20)T13.200021.80[2]
The JSA captures the team, believing them to be Nazi spies. Nate reveals that he is the grandson of JSA member Commander Steel. After the JSA is assigned a mission to obtain information on Nazi captain Baron Krieger, they release the team and advise them to leave 1942. The JSA learns that Krieger intends to trade away an amulet in Adolf Hitler's possession; his trade partner turns out to be Eobard, who has given him a sample of the serum with which he intends to barter. Nate soon discovers that the JSA dies on this mission, so the team returns to rescue them. While the teams collect the amulet and fight the Nazis, Krieger uses the serum on himself and turns into a monstrous superhuman. Krieger captures Ray and Amaya. Ray offers to replicate the formula to save Amaya. The teams are able to rescue Ray and Amaya, and defeat Krieger. However, Nate, a hemophiliac, is injured in the fighting. He is saved with a modified version of the serum created by Ray. Before the team departs, Eobard infiltrates JSA headquarters and stabs Rex Tyler with his vibrating hand before stealing the amulet. A dying Rex whispers "time traveler" to Amaya.
193"Shogun"Kevin TancharoenPhil Klemmer & Grainne GodfreeOctober 27, 2016 (2016-10-27)T13.200031.75[3]
Amaya stows away on the Waverider and attacks Mick, believing him responsible for Rex's death. Nate stops her using his newly-developed ability to convert his body to a steel-like form. Sara convinces Amaya that a rogue time traveler is likely to blame for the murder. An accident during Ray's testing of Nate's abilities throws both men into the time vortex and strands them in 17th-century feudal Japan. Nate is found and cared for by Masako Yamashiro, the betrothed of shogun Tokugawa Iemitsu whose samurai capture Ray. Sara, Amaya, and Mick rescue Ray from Tokugawa, who uses the Atom suit against them. They meet up with a recovered Nate, who does not want to leave Masako to Tokugawa's mercy. They defend Masako's village from the samurai, while Ray and Nate defeat Tokugawa by destroying the Atom suit. Nate and Amaya officially join the team. Meanwhile, Jax and Stein discover a hidden armory inside the ship and a secret message from Barry Allen from 2056 intended for Rip and forbidden from the crew.
204"Abominations"Michael AllowitzMarc Guggenheim & Ray UtarnachittNovember 3, 2016 (2016-11-03)T13.200041.75[4]
The team learns of a time pirate stranded in the American Civil War. Upon arriving, they encounter a black man, Henry Scott, being chased by Confederate soldiers that have been turned into zombies by a virus carried by the pirate. The team defeats the group of zombies, but Henry is killed. Before his death, Henry reveals he is a Union spy assigned to steal Confederate battle plans for General Grant and asks Jax to complete his mission. The team discovers that Mick is infected with the virus and returns him to the Waverider, where Ray and Martin ultimately manage to cure him. Sara and Nate go to warn Grant about the zombies while Jax and Amaya attempt to steal the plans. Jax runs afoul of a plantation owner and is locked up. Amaya frees him and the other black prisoners. They find the plans and burn down the mansion during a zombie attack. Meanwhile, Grant's camp is also attacked by zombies. Sara formulates a successful plan to kill them using Nate's powers. Jax, posing as Henry Scott, gives the plans to Grant, which will ensure a Union battle victory. A grateful Mick gives Leonard Snart's cold gun to Ray.
215"Compromised"David GeddesKeto Shimizu & Grainne GodfreeNovember 10, 2016 (2016-11-10)T13.200051.77[5]
In 1987, Eobard Thawne offers Damien Darhk an alliance, which Darhk declines. Aboard the Waverider, Nate discovers an aberration in 1987 involving the INF Treaty signing. The team infiltrates the White House as tourists and finds Darhk there as one of the treaty negotiators. Sara again attempts to kill him, which alerts White House security and forces the team to make a very public escape. They soon learn that Darhk is making his own secret deal with the KGB. Returning to the White House during a state dinner, they discover him and H.I.V.E. making an exchange with KGB agents for a box with an unknown item. The team defeats the H.I.V.E soldiers and the Russians. Sara confronts Darhk, but spares his life. Instead, she reveals his future to torture him: his master plan's failure, his wife's murder, and his own eventual death. Eobard whisks Darhk away, but not before Sara steals the box from him. She realizes the team is up against a time-traveling speedster. Unnerved by Sara's revelation, Darhk insists on teaming up with Eobard and the two enter the time stream.
226"Outlaw Country"Cherie NowlanMatthew Maala & Chris FedakNovember 17, 2016 (2016-11-17)T13.200061.85[6]
The team learns of an aberration in Colorado, 1874, where they save Jonah Hex from execution. He reveals that he is fighting an outlaw boss named Quentin Turnbull. Nate reveals that the aberration is Turnbull leading the Western US in its secession to form "Turnbull Country". The team learns that Turnbull is extracting dwarf star, which Ray used for his A.T.O.M. suit, and that Turnbull is planning to destroy a critical mountain pass connecting the Eastern US to the West, stopping the US Army from supplying the West. While Sara and Jonah engage Turnbull, Mick and Amaya destroy the mine and Nate uses his powers to stop the train. Instead of killing Turnbull, Jonah decides to deliver him to the authorities. With the dwarf star reappropriated, Ray plans to rebuild his suit and shows Nate the suit he has made for the latter. Amaya decides to teach Mick to control his anger. Martin and Jax deduce that, due to the former's interaction with his past self, he may have altered the past. Sara tells the team that they need to return to 2016 to help their friends.
237"Invasion!"Gregory SmithStory by : Greg Berlanti Teleplay by : Phil Klemmer & Marc GuggenheimDecember 1, 2016 (2016-12-01)T13.200073.39[7]
Nate, Mick, Amaya, Felicity, and Cisco travel back to the first Dominator invasion of Earth in Redmond, Oregon, 1951. The Legends successfully capture a Dominator for information, but are themselves captured by the MIB as well as the Dominator. While in custody, they learn from the Dominator that the aliens arrived to assess the threat humanity posed now that metahumans had appeared. Felicity and Cisco rescue the Legends and help set the Dominator free. Meanwhile in Central City 2016, the team learns that the Dominators know about Barry's manipulation of the timeline and that they demand his surrender in exchange for peace. After the Legends return, the team discovers that the Dominators' weapon is a bomb that will kill all metahumans on Earth with millions of collateral human casualties. The team dissuades Barry from surrendering and Cisco reconciles with him. They manage to destroy the bomb and force the Dominators to retreat using pain-inflicting nanotechnology. Cisco gives Supergirl a device to travel between their universes. Martin convinces Jax not to tell the others that his daughter, Lily, is an aberration of the timeline.

This episode concludes a crossover event that begins on The Flash season 3 episode 8, and continues on Arrow season 5 episode 8.
248"The Chicago Way"Ralph HemeckerSarah Nicole Jones & Ray UtarnachittDecember 8, 2016 (2016-12-08)T13.200082.00[8]
Eobard, Darhk and Malcolm Merlyn arrive in Chicago, 1927, and ally with Al Capone and his empire. Learning of the aberration, the Legends arrive and manage to keep Capone from murdering Eliot Ness. Ness is critically injured, so the team decides to obtain vital information on Capone's operation to secure history. Meanwhile, Mick begins having hallucinations of Snart, who belittles him for acting like his teammates. Sara and Martin are abducted by Eobard during their infiltration and raid on Capone's club. Malcolm offers Sara a chance to change her past in return for the amulet she took from Darhk in 1987, but she refuses. The team rescues the captives, but "Martin" turns out to be a disguised Eobard, who searches the Waverider at super-speed for the amulet while Malcolm and Capone's men attack the ship directly. Eobard barely escapes revenge at Amaya's hand, but Sara surrenders the amulet for Martin's safety. The Legends succeed in correcting the timeline. Eobard later shows his partners that the completed amulet projects a holographic map that can locate the Spear of Destiny, which is able to "rewrite reality itself". They must next locate Rip Hunter, who is revealed to be working as a movie director in 1967 Los Angeles.
259"Raiders of the Lost Art"Dermott DownsKeto Shimizu & Chris FedakJanuary 24, 2017 (2017-01-24)T13.200091.74[9]
During the New York attack, Rip recovered the Spear of Destiny from the Waverider and used the time drive to escape. In the present, the team learns about the spear and arrives in Los Angeles, 1967, where they find Darhk and Malcolm attempting to kidnap Rip, who has no memories of his previous adventures and is filming with George Lucas. Both parties escape and Rip is arrested by the police as they believe he started the fight. The team springs him from custody and takes him to the Waverider. Nate and Ray are revealed to have lost their specialities and powers since the aberration caused Lucas to quit filmmaking. While Nate, Amaya, and Ray meet Lucas to dissuade him from dropping out of school, the others learn that Lucas had a fragment of the spear. Darhk and Malcolm overpower Amaya's party and force them to search for the fragment in a dumpster. The others arrive and a battle ensues during which they recover the fragment and the Medallion. Rip, however, is abducted by Eobard and threatened with torture by Malcolm and Darhk. Lucas returns to filmmaking and the team vows to rescue Rip. Meanwhile, Mick tells Stein about his hallucinations, but the latter eventually interprets them to be emotional, not neural.
2610"The Legion of Doom"Eric LaneuvillePhil Klemmer & Marc GuggenheimJanuary 31, 2017 (2017-01-31)T13.200101.78[10]
In Star City 2016, Eobard and Damien recruit Malcolm just hours after the 2016 Damien is killed by Oliver. The Legion's attempts to extract information from Rip fail repeatedly, exacerbating tensions within the group. Eobard disappears after insisting on his superiority, assigning Malcolm and Damien to access Rip's bank safe deposit box in Switzerland 2025, the number of which Damien found engraved on Rip's tooth. Meanwhile, Martin recruits Lily to help the team decode the amulet. She finds out that she is an aberration and gets angry with Martin. After a failed robbery, Malcolm and Damien decide to work together against Eobard. The Legends realize that the mystery speedster is Eobard and that he needs the spear to undo his removal from existence. Damien and Malcolm break into the bank vault, finding a record of Rip's memories. They force Eobard to tell the truth about his disappearances. He reveals that Hunter Zolomon, now the undead speedster Black Flash, has been chasing him since Flashpoint. They manage to trap the pursuing speedster in the vault and escape, with Eobard agreeing to treat the duo as his equals. Lily returns home after she and Martin reconcile, while the Legion restores Rip's memories, albeit with "adjustments". In New Jersey on Christmas Day 1776, Rip kills George Washington.
2711"Turncoat"Alice TroughtonGrainne Godfree & Matthew MaalaFebruary 7, 2017 (2017-02-07)T13.200111.77[11]
Rip has been brainwashed into working for the Legion. The Legends, who feel the subsequent timequake, head to Christmas Eve 1776, to protect Washington. As Sara and Mick escort Washington to safety, Rip arrives with British troops who have been armed with modern-day assault rifles. Rip disables the team's technology and shoots Sara in the chest, opting to take Mick and Washington prisoner. Rip then heads to the Waverider with British soldiers to retrieve the Legends' piece of the spear. The team takes out the British. Jax holds off Rip while a shrunken Ray works to fix the Waverider. Amaya and Nate share a tender moment in the wilderness and are attacked by Hessians though they manage to defeat them.. After Mick hears that Washington will be executed in the morning, he formulates an escape plan and teaches the General what it means to be an American. Rip uses Sara's life as leverage to get Jax to give him the spear fragment before strangling her anyway. The Waverider's power is restored and Sara is revived in time to stop an enraged Jax from murdering Rip. Nate and Amaya save Mick and Washington, who goes on to lead his soldiers to victory in the American Revolution. Amaya tells Nate they should remain friends and the team celebrates Christmas on the Waverider.
2812"Camelot/3000"Antonio NegretAnderson MackenzieFebruary 21, 2017 (2017-02-21)T13.200121.64[12]
Rip finds former JSA member Dr. Mid-Nite in Detroit, 3000, killing him and taking his spear fragment. Gideon locates the next fragment in Medieval England, 507 A.D., the age of King Arthur. Amaya recognizes Merlin as Stargirl, her former comrade in the JSA. She explains that Hunter joined the JSA on their final mission to secure the spear. He divided it into four pieces for more safety. The Legion abducts Arthur and controls his mind using a device taken from 3000 in order to enter Camelot, threatening to destroy it unless the spear is brought to them. Sara persuades Guinevere to help them fight back while Amaya convinces Stargirl, who is in love with Arthur, to entrust her with the fragment. Upon learning that Ray has joined Guinevere's army, the team devises a plan to reverse the effects of the device and Arthur subdues Rip. Ray engages Damien and gets shot, but survives due to his suit's armor. In the changed history, Ray is revealed to have become a knight. Imprisoned in the brig, Rip contacts Gideon, whose programming maintains loyalty to him.
2913"Land of the Lost"Ralph HemeckerKeto Shimizu & Ray UtarnachittMarch 7, 2017 (2017-03-07)T13.200131.54[13]
Rip issues an override order to Gideon to activate the Waverider's self-destruct sequence, but the team manages to reboot Gideon and stop it. They crash land in the Cretaceous period and Ray, Amaya, and Nate venture out to recover a lost timeship part. Mick suggests using a Time Master method of mental programming to travel inside Rip's mind and discover the location of Commander Steel and the final piece of the spear. Sara and Jax travel inside Rip's mind, encountering Savage's men, evil versions of themselves, Gideon in human form, and a trapped Rip. Ray, Nate, and Amaya retrieve the missing part with Amaya using her abilities to stop a dinosaur from attacking them. Nate and Amaya start to develop mutual feelings, but Ray advises against this, reminding Nate that Amaya's granddaughter will eventually inherit her abilities. Sara, Jax, and Gideon free Rip's consciousness before Sara and Jax return to reality. Rip shares a kiss with the human Gideon before returning to reality and resuming his role as Captain, informing the team that he does know the location of Commander Steel and the last piece of the spear. Meanwhile in 1970, Jack Swigert, Apollo 13's Command Module Pilot, has a meeting with a doctor revealed to be Eobard Thawne.
3014"Moonshot"Kevin MockGrainne GodfreeMarch 14, 2017 (2017-03-14)T13.200141.34[14]
The Legends head to NASA in 1970, where Henry Heywood works as a consultant. Henry reveals that he hid his spear fragment in the flag left by Apollo 11 on the moon and that the Apollo 13 mission is going exactly as planned. Thawne, posing as Jack Swigert, incapacitates the other astronauts. Ray boards the Apollo command module and restrains Thawne before retrieving the spear fragment. The Waverider is damaged when Sara uses the ship to shield the Apollo craft from meteors, stranding Ray on the moon. Ray and Thawne launch themselves off the moon and are caught by the Waverider. The team return to Earth intact after Henry sacrifices himself by opening one of the Waverider's outer hatches, being sucked outside the ship. Nate, disappointed that he wasn't able to create a potentially better life for his family, passes on a message from Henry to his teenage father. Sara and Rip seem to clash over how to captain the ship, but eventually reach an understanding. Amaya asks Gideon to show her the fate of her village and her family, revealing the destruction of her village and existence of her granddaughter Mari, the present-day Vixen.
3115"Fellowship of the Spear"Ben BrayKeto Shimizu & Matthew MaalaMarch 21, 2017 (2017-03-21)T13.200151.72[15]
The Legends steal the remaining spear fragment. Upon it becoming whole again, the spear's writings reveal it can be destroyed by the blood of Jesus Christ. Rip prevents the Waverider from traveling to the Crucifixion, warning that going back to such a significant event is too risky. Nate reveals that J. R. R. Tolkien researched Sir Gawain, who supposedly possessed some of Christ's blood. They find Tolkien at the Battle of the Somme. Tolkien takes the Legends to a grave, where they are attacked by Darhk and a past version of Snart, who has been recruited to the Legion. Tolkien acquires a map before escaping with the others. Amaya, tempted by the Spear's power, suggests using the spear to erase the Legion from reality, but the idea is rejected. Using the map and the spear, the blood is tracked to no man's land. Rip creates a temporary ceasefire, during which the Legends acquire the blood. They are confronted by Darhk and Snart, who convince Mick to give them the spear and join the Legion. Snart retriggers the battle, allowing for their escape and the destruction of the blood. The Legends manage to escape back to the Waverider and discuss the possibility that the Legion may not know how to use the Spear. Malcolm returns to the Legion with the Kalebros Manuscript which they must use to activate the spear.
3216"Doomworld"Mairzee AlmasRay Utarnachitt & Sarah HernandezMarch 28, 2017 (2017-03-28)T13.200161.59[16]
In the new reality, Thawne is the CEO of S.T.A.R. Labs and has captured the Black Flash, Darhk is the corrupt mayor of Star City, Merlyn gets his hand back and his family is alive, and Snart and Rory control Central City but still answer to Thawne as their superior. Ray, Stein, and Jax work in S.T.A.R. Labs where Jax abuses Stein. Sara and Amaya work as Darhk's enforcers and Nate is a conspiracy theorist. A depressed Rip is held prisoner onboard the Waverider by Thawne and is the only member of the Legends unaffected by the changes to the timeline. Mick, unsatisfied with this reality, takes Nate to re-assemble the Legends, using a gun Ray created to restore the Legends’ memories. Stein, in an effort to stand up to Jax, breaks the gun after the latter attempts to use it on him. The Legends attempt to reclaim the Spear before Thawne can use Stein's incinerator to destroy it, cementing the new reality. Darhk, Merlyn, and Snart ally against Thawne to take the Spear for themselves. In the ensuing fight, Amaya is killed by Snart while attempting to restore reality. Thawne destroys the Spear, trapping everyone in his reality. The Legends decide to stop the Legion by travelling to 1916 and taking the Spear before the Legion does. At S.T.A.R. Labs, Rip and the Waverider are shown to be miniaturized on Thawne's desk.
3317"Aruba"Rob SeidenglanzPhil Klemmer & Marc GuggenheimApril 4, 2017 (2017-04-04)T13.200171.52[17]
The Legends regain contact with Rip and the Waverider, which Ray de-miniaturizes. The team returns to 1916 to steal the Spear before the Legion can use it. Thawne arrives from the altered reality. He destroys the blood of Christ, kills "future Ray," and informs the past Legion members about the future Legends. The Legends end up interacting with their past selves. The resulting time storm prevents the use of the past Waverider to escape. Shortly after, they are ambushed by Merlyn, Darhk, and Snart. During the subsequent battle, the future Legends are killed by the Legion except Sara and Rip, while the Legion is incapacitated by the past Legends. Thawne arrives with numerous time remnants of himself to fight the team, killing future Rip. Sara takes the Spear and consults a manifestation of Laurel. Eobard steals and attempts to use the Spear, only to learn Sara depowered the Spear and released the Black Flash. Eobard is erased from existence, along with the Spear of Destiny, while future Sara fades from existence. Nate convinces Amaya to stay, while Rip leaves the team. The Legends leave the Legion in their respective places throughout the timeline and, at Mick's request, set off for Aruba. However, they arrive in Los Angeles, with dinosaurs in the streets and buildings present from other points of history.

text: Cast and characters[edit]

text: Main[edit]

text:
Victor Garber as Martin Stein / Firestorm
Brandon Routh as Ray Palmer / Atom
Arthur Darvill as Rip Hunter
Caity Lotz as Sara Lance / White Canary
Franz Drameh as Jefferson Jackson / Firestorm
Matt Letscher as Eobard Thawne / Reverse-Flash
Maisie Richardson-Sellers as Amaya Jiwe / Vixen
Amy Pemberton as Gideon
Nick Zano as Nate Heywood / Steel
Dominic Purcell as Mick Rory / Heat Wave

text: Recurring[edit]

text:
Neal McDonough as Damien Darhk
John Barrowman as Malcolm Merlyn
Wentworth Miller as Leonard Snart / Captain Cold

text: Guest[edit]

text:
Stephen Amell as Oliver Queen / Green Arrow[18]
Christiaan Westerveld as King Louis XIII[19]
Rebecca Eady as Queen Anne[19]
John Rubinstein as Albert Einstein[20]
Christina Jastrzembska as Mileva Marić[19]
Patrick J. Adams as Rex Tyler / Hourman[21]
Matthew MacCaull as Henry Heywood, Sr. / Commander Steel[22]
Sarah Grey as Courtney / Stargirl[23]
Kwesi Ameyaw as Charles / Dr. Mid-Nite[24]
Dan Payne as Todd Rice / Obsidian[25]
Lance Henriksen portrays an older version of the character[26][27]
André Eriksen as Baron Krieger[28]
Mei Melançon as Masako Yamashiro[29]
Sab Shimono as Ichiro Yamashiro[29]
John Churchill as Ulysses S. Grant[30]
Emily Tennant as Clarissa Stein[31]
Johnathon Schaech as Jonah Hex[32]
Christina Brucato as Lily Stein[33]
Grant Gustin as Barry Allen / Flash[34][35]
Jeff Fahey as Quentin Turnbull[36]
Carlos Valdes as Cisco Ramon[35]
Donnelly Rhodes as "Glasses"[a]
Jacob Richtor portrays a younger version of the character[35]
Lucia Walters as Susan Brayden[35]
David Ramsey as John Diggle / Spartan[38]
Danielle Panabaker as Caitlin Snow[35]
Melissa Benoist as Kara Danvers / Supergirl[39]
Isaac Keoughan as Al Capone[40]
Matt Angel as George Lucas[41]
Randall Batinkoff as George Washington[42]
Noel Johansen as Charles Cornwallis[43]
Nils Hognestad as King Arthur[44]
Elyse Levesque as Guinevere[45]
Jack Turner as J. R. R. Tolkien[46]
Katie Cassidy as Laurel Lance[47]

text: Production[edit]

text: Development[edit]

text: On March 11, 2016, Legends of Tomorrow was renewed for a second season.[48] After the first season, the producers considered adjusting the Legends team for additional seasons, with Joseph David-Jones' Connor Hawke and Megalyn Echikunwoke's Mari McCabe / Vixen potential additions.[49][50] For the second season, showrunner Phil Klemmer revealed that Arrow writer Keto Shimizu and The Flash writer Grainne Godfree would be working on Legends in order to "make our stories work in concert" with Arrow and The Flash. Klemmer also noted the challenges of creating more crossover elements, since Arrow's lead actor Stephen Amell and The Flash's lead actor Grant Gustin work full days for their respective shows. In terms of working within the Arrowverse, Klemmer said that the death of Laurel Lance on Arrow would "resonate into Season 2... [since] something that happens on Arrow can create ripples that appear on our show in a huge way. It fundamentally alters the DNA of our series."[51] The second season initially consisted of 13 episodes,[52] with four more ordered in November 2016 to bring the season total to 17.[53]

tag: p

text: Teasing the premise of season two in April 2016, Klemmer stated, "We're coming at it from a completely different angle. We're determined to make every part of season two feel like its own show. [The first episode of season two] will very much be a new pilot with new good guys, new bad guys, new stakes, new dynamics, new goals. The team will basically have to find a new purpose. Once you save the world, what do you do then?... The fact that the world was in peril sort of forced our team to fall into its own dysfunctional version of lockstep. Season two, they're no longer going to be hunted by Time Masters. They're no longer going to be burdened with having to save the world. It's no longer going to be about saving Miranda and Jonas. The interesting thing about season two is I think it's going to have a much, much different tone because our Legends are going to have a totally different purpose. They're actually going to have a totally different constitution. There will be new faces and new everything."[51] The season also introduced members of the Justice Society of America.[54] The Society consisted of Hourman, Vixen, Commander Steel, Obsidian, Stargirl and Dr. Mid-Nite.[55] The season also featured a version of the Legion of Doom, composed of Eobard Thawne / Reverse-Flash, Malcolm Merlyn, Damien Darhk and Leonard Snart / Captain Cold.[18]

text: Casting[edit]

text: Main cast members Victor Garber, Brandon Routh, Arthur Darvill, Caity Lotz, Franz Drameh, Amy Pemberton, and Dominic Purcell returned from the previous season as Martin Stein, Ray Palmer, Rip Hunter, Sara Lance, Jefferson Jackson, Gideon, and Mick Rory, respectively.[18][56] They were joined by Matt Letscher, Maisie Richardson-Sellers and Nick Zano, playing Eobard Thawne,[57] Amaya Jiwe,[58] and Nate Heywood, respectively.[59] Letscher reprised his role from The Flash.[57] It was originally intended for Megalyn Echikunwoke, who voices Mari McCabe / Vixen in the animated web series Vixen, to reprise her role in this series, but due to scheduling conflicts for Echikunwoke, the producers instead cast Sellers as Jiwe, McCabe's grandmother and an earlier incarnation of Vixen.[58] This incarnation was an original creation for the series.[60] Darvill was absent for most of the season due to his commitment to the ITV series Broadchurch.[61] Pemberton physically portrayed Gideon in the episode "Land of the Lost", unlike earlier episodes where she only voiced the character.[56]

text: Wentworth Miller, who portrayed Leonard Snart / Captain Cold as a regular in season one, signed a contract with Warner Bros. TV to continue portraying Snart simultaneously on multiple shows in the Arrowverse, including Legends of Tomorrow.[62] John Barrowman, who portrayed Malcolm Merlyn on Arrow, signed a similar contract that allowed him to continue being a series regular on Arrow as well as the other Arrowverse shows, including The Flash and Legends of Tomorrow.[63] Neal McDonough, who recurred as Damien Darhk on Arrow and made a guest appearance in season one of Legends of Tomorrow, returned to the series in a recurring capacity.[18] Ciara Renée and Falk Hentschel, who starred as Kendra Saunders / Hawkgirl and Carter Hall / Hawkman respectively in the first season, did not return for the second, with Legends of Tomorrow co-creator Marc Guggenheim saying the writers could not find a suitable story for their characters set after the first season, adding, "The bow was tied so tightly and neatly with their story in the finale, that everything we thought of felt very forced. After 4000 years, they were no longer under the specter of Vandal [Savage], and we felt they need some time off." He added that bringing the duo back at the very beginning of the second season felt "premature."[64]

text: Filming[edit]

text: Shooting for the season began in July 2016 at Vancouver,[65] and ended in February 2017.[66]

text: Arrowverse tie-ins[edit]

text: In November 2016, the cast of Legends of Tomorrow appeared on The Flash and Arrow as part of the three-part "Invasion!" crossover event; the crossover episodes also featured appearances by Melissa Benoist, reprising her role as Kara Danvers / Supergirl from the TV series Supergirl.[67][38]

text: Release[edit]

text: Broadcast[edit]

text: The season began airing on October 13, 2016 on The CW in the United States,[1] and concluded on April 4, 2017.[17]

text: Home media[edit]

text: The season was made available for streaming on Netflix in late April 2017, soon after the season finale aired.[68] It was later released on Blu-ray on August 15, 2017.[69]

text: Reception[edit]

text: Ratings[edit]

text:
No.

Title

Air date
Rating/share(18–49)
Viewers(millions)
DVR(18–49)
DVR viewers(millions)
Total(18–49)
Total viewers(millions)

1

"Out of Time"

October 13, 2016
0.6/2
1.82[1]
0.6
1.19
1.2
3.01[70]

2

"The Justice Society of America"

October 20, 2016
0.7/2
1.80[2]
N/A
1.03
N/A
2.83[71]

3

"Shogun"

October 27, 2016
0.6/2
1.75[3]
0.4
0.96
1.0
2.71[72]

4

"Abominations"

November 3, 2016
0.6/2
1.75[4]
0.4
0.99
1.0
2.74[73]

5

"Compromised"

November 10, 2016
0.6/2
1.77[5]
0.4
0.98
1.0
2.75[74]

6

"Outlaw Country"

November 17, 2016
0.6/2
1.85[6]
0.5
N/A
1.1[75]
N/A

7

"Invasion!"

December 1, 2016
1.2/4
3.39[7]
0.7
1.84
1.9
5.24[76]

8

"The Chicago Way"

December 8, 2016
0.7/3
2.00[8]
0.5
1.17
1.2
3.17[77]

9

"Raiders of the Lost Art"

January 24, 2017
0.6/2
1.74[9]
N/A
1.14
N/A
2.94[78]

10

"The Legion of Doom"

January 31, 2017
0.7/3
1.78[10]
0.5
1.19
1.2
2.96[79]

11

"Turncoat"

February 7, 2017
0.7/3
1.77[11]
N/A
1.10
N/A
2.87[80]

12

"Camelot/3000"

February 21, 2017
0.6/2
1.64[12]
0.5
1.06
1.1
2.70[81]

13

"Land of the Lost"

March 7, 2017
0.5/2
1.54[13]
0.5
1.07
1.0
2.61[82]

14

"Moonshot"

March 14, 2017
0.5/2
1.34[14]
0.3
1.01
0.8
2.35[83]

15

"Fellowship of the Spear"

March 21, 2017
0.6/2
1.72[15]
N/A
0.98
N/A
2.70[84]

16

"Doomworld"

March 28, 2017
0.5/2
1.59[16]
0.5
1.01
1.0
2.60[85]

17

"Aruba"

April 4, 2017
0.6/2
1.52[17]
N/A
0.87
N/A
2.39[86]

text: Critical response[edit]

text: This section needs expansion. You can help by adding to it. (July 2018)

text: Rotten Tomatoes gave the season an 80% approval rating, with an average rating of 6.06/10 based on 15 reviews. The website's consensus reads: "Though the narrative remains too ambitious, DC's Legends of Tomorrow enjoys a freer creative arc with the removal of problem characters."[87] Jesse Schedeen of IGN called it a significant improvement over the first season, saying it reduced "most of what didn't work about Season 1 and added several worthy new characters to the mix." He noted that while the season was "crammed full of compelling character arc s and plot twists", it thrived simply by "offering a sense of whimsical adventure and comedy that be frustratingly hard to find in other live-action DC projects."[88]

text: Notes[edit]

text: Jump up ^ Although referred to onscreen as "Agent Smith",[35] the producers call him "Glasses".[37]


document_title: Boogie Nights

question_text: who are the characters in boogie nights based on

text: Boogie Nights

text: Plot[edit]

text: In 1977, Eddie Adams is a high-school dropout living with his stepfather and emotionally abusive mother in Torrance, California. He works at the Reseda nightclub owned by Maurice Rodriguez, where he meets porn filmmaker Jack Horner, who auditions him by watching him have sex with Rollergirl, a porn starlet who always wears skates. After having an argument with his mother about his girlfriend and sex life, Adams moves in with Horner at his San Fernando Valley home. Adams gives himself the screen name "Dirk Diggler", and becomes a star because of his good looks, youthful charisma, and unusually large penis. His success allows him to buy a new house, an extensive wardrobe, and a "competition orange" 1977 Chevrolet Corvette Stingray. With friend and fellow porn star Reed Rothchild, Dirk pitches a series of successful action-themed porn films. Dirk works and socializes with others from the porn industry, and they live carefree lifestyles in the late 1970s disco era. That changes at a New Year's Eve party at Horner's house marking the year 1980, when assistant director Little Bill Thompson discovers his porn-star wife having sex with another man, shoots them both and kills himself.

text: Dirk and Reed begin using cocaine. Due to Dirk's drug use, he finds it increasingly difficult to achieve an erection, falls into violent mood swings and becomes upset with Johnny Doe, a new leading man Jack has recruited. In 1983, after having an argument with Jack, Dirk is fired, and he and Reed leave to start a rock and roll career along with Scotty, a boom operator who loves Dirk. Jack rejects business overtures from Floyd Gondolli, a theater magnate in San Diego and San Francisco, who insists on cutting costs by shooting on videotape, because Jack believes that video will diminish the quality of his films. After his friend and financier Colonel James is imprisoned for possession of child pornography, Jack works with Gondoli, becoming disillusioned with the projects he expects him to churn out. One of these projects involves Jack and Rollergirl riding in a limousine, searching for random men for her to have sex with, while being taped by a crew. When one man recognizes Rollergirl as a former high-school student, he insults her and Jack, who attack the man, leaving him injured on the sidewalk as the crew drives off.

text: Leading lady Amber Waves finds herself in a custody battle with her ex-husband. The court determines she is an unfit mother, due to her involvement in the porn industry, prior criminal record and cocaine addiction. Buck Swope marries fellow porn star Jessie St. Vincent, who becomes pregnant. Because of his past, Buck is disqualified from a bank loan and cannot open his own stereo-equipment store. That night, he finds himself in the middle of a holdup in which the clerk, the robber and an armed customer are killed. Buck escapes with the money that the robber demanded. Having squandered their money on drugs, Dirk and Reed cannot pay a recording studio for demonstration tapes they believe will enable them to become music stars. Desperate for money, Dirk resorts to prostitution, but is assaulted and robbed by three men. Dirk, Reed and their friend Todd attempt to scam local drug dealer Rahad Jackson, by selling him a half-kilo of baking soda as cocaine. Dirk and Reed decide to leave before Rahad's bodyguard inspects it, but Todd fails to steal money from Rahad, who kills him in the ensuing gunfight. Dirk reconciles with Jack.

text: In 1984, Buck and Jessie give birth to their son, Amber shoots the television commercial for Buck's store opening, Reed practices a successful magic act at the strip club, Colonel James remains in prison, and Rollergirl returns to high school. Dirk and Amber prepare to start filming again.

text: Cast[edit]

text:
Mark Wahlberg as Eddie Adams (Dirk Diggler)
Julianne Moore as Maggie (Amber Waves)
Burt Reynolds as Jack Horner
Don Cheadle as Buck Swope
John C. Reilly as Reed Rothchild
William H. Macy as "Little" Bill Thompson
Heather Graham as Brandy ("Rollergirl")
Nicole Ari Parker as Becky Barnett
Philip Seymour Hoffman as Scotty J.
Luis Guzmán as Maurice Rodriguez
Philip Baker Hall as Floyd Gondolli
Thomas Jane as Todd Parker
Robert Ridgely as the Colonel James
Nina Hartley as "Little" Bill's wife
Melora Walters as Jessie St. Vincent
Alfred Molina as Rahad Jackson
Ricky Jay as Kurt Longjohn

text: Production[edit]

text: Development[edit]

text: Boogie Nights is based on a mockumentary short film that Anderson made while he was still in high school called The Dirk Diggler Story.[3] The short was based on the 1981 documentary Exhausted: John C. Holmes, The Real Story, a documentary about the life of legendary porn actor John Holmes, the person on whom Dirk Diggler is based.[7]

text: He originally wanted the role of Eddie to be played by Leonardo DiCaprio, after seeing him in The Basketball Diaries. DiCaprio enjoyed the screenplay, but had to turn it down because he signed on to star in Titanic. He recommended Mark Wahlberg for the role.[7] Joaquin Phoenix was also offered the role of Eddie, but turned it down due to concerns about playing a porn star. Phoenix later collaborated with Anderson in the films, The Master and Inherent Vice.[8] Bill Murray, Harvey Keitel, Warren Beatty, Albert Brooks and Sydney Pollack declined or were passed up on the role of Jack Horner, which went to Burt Reynolds.[9] After starring in Hard Eight, Samuel L. Jackson declined the role of Buck Swope, which went to Don Cheadle.[7] Anderson initially did not consider Heather Graham for the role of Rollergirl, because he had never seen her do nudity in a film. However, Graham's agent called Anderson asking if she could read for the part, which she won.[7] Drew Barrymore and Tatum O'Neal were also up for the role.[9]

text: After having a very difficult time getting his previous film, Hard Eight, released, Anderson laid down a hard law when getting Boogie Nights made. He initially wanted the film to be over three hours long and be rated NC-17. The film's producers, particularly Michael De Luca, said that the film had to be either under three hours or rated R. Anderson fought with them, saying that the film would not have a mainstream appeal no matter what. They did not change their minds, and Anderson chose the R rating as a challenge. Despite this, the film was still 20 minutes shorter than promised.[7]

text: Reynolds did not get along with Anderson while filming. After seeing a rough cut of the film, Reynolds fired his agent for recommending it. Despite this, Reynolds won a Golden Globe Award and was nominated for an Academy Award for his performance.[10]  Later, Anderson wanted Reynolds to star in his next film, Magnolia, but Reynolds declined it.[11] Since then, Reynolds has stated that he is proud of the film, saying that his opinion of it has nothing to do with his relationship with Anderson.[12]

text: Reception[edit]

text: Critical reception[edit]

text: The film premiered at the Toronto International Film Festival and was shown at the New York Film Festival, before opening on two screens in the U.S. on October 10, 1997. It grossed $50,168 on its opening weekend. Three weeks later, it expanded to 907 theaters and grossed $4,681,934, ranking number four for the week. It eventually earned $26,400,640 in the U.S. and $16,700,954 in foreign markets for a worldwide box office total of $43,101,594.[13]

text: The film currently has 93% positive reviews on film review aggregator site Rotten Tomatoes, with 61 of 66 counted reviews giving it a "fresh" rating and an average rating of 8.2 out of 10. The site's consensus states: "Grounded in strong characters, bold themes, and subtle storytelling, Boogie Nights is a groundbreaking film both for director P.T. Anderson and star Mark Wahlberg."[14] On Metacritic, the film holds an average score of 85 out of 100, based on 28 reviews, indicating "universal acclaim".[15]

text: Janet Maslin of The New York Times said, "Everything about Boogie Nights is interestingly unexpected," although "the film's extravagant 2-hour 32-minute length amounts to a slight tactical mistake ... [it] has no trouble holding interest ... but the length promises larger ideas than the film finally delivers." She praised Burt Reynolds for "his best and most suavely funny performance in many years" and added, "The movie's special gift happens to be Mark Wahlberg, who gives a terrifically appealing performance."[16]

text: Roger Ebert of the Chicago Sun-Times observed, "Few films have been more matter-of-fact, even disenchanted, about sexuality. Adult films are a business here, not a dalliance or a pastime, and one of the charms of Boogie Nights is the way it shows the everyday backstage humdrum life of porno filmmaking ... The sweep and variety of the characters have brought the movie comparisons to Robert Altman's Nashville and The Player. There is also some of the same appeal as Pulp Fiction in scenes that balance precariously between comedy and violence ... Through all the characters and all the action, Anderson's screenplay centers on the human qualities of the players ... Boogie Nights has the quality of many great films, in that it always seems alive."[17]

text: Mick LaSalle of the San Francisco Chronicle stated, "Boogie Nights is the first great film about the 1970s to come out since the '70s ... It gets all the details right, nailing down the styles and the music. More impressive, it captures the decade's distinct, decadent glamour ... [It] also succeeds at something very difficult: re-creating the ethos and mentality of an era ... Paul Thomas Anderson ... has pulled off a wonderful, sprawling, sophisticated film ... With Boogie Nights, we know we're not just watching episodes from disparate lives but a panorama of recent social history, rendered in bold, exuberant colors."[18]

text: Kenneth Turan of the Los Angeles Times called it "a startling film, but not for the obvious reasons. Yes, its decision to focus on the pornography business in the San Fernando Valley in the 1970s and 1980s is nerviness itself, but more impressive is the film's sureness of touch, its ability to be empathetic, nonjudgmental and gently satirical, to understand what is going on beneath the surface of this raunchy Nashville-esque universe and to deftly relate it to our own ... Perhaps the most exciting thing about Boogie Nights is the ease with which writer-director Anderson ... spins out this complex web. A true storyteller, able to easily mix and match moods in a playful and audacious manner, he is a filmmaker definitely worth watching, both now and in the future."[dead link][19]

text: Peter Travers of Rolling Stone said, "[T]his chunk of movie dynamite is detonated by Mark Wahlberg ... who grabs a breakout role and runs with it ... Even when Boogie Nights flies off course as it tracks its bizarrely idealistic characters into the '80s ... you can sense the passionate commitment at the core of this hilarious and harrowing spectacle. For this, credit Paul Thomas Anderson ... who ... scores a personal triumph by finding glints of rude life in the ashes that remained after Watergate. For all the unbridled sex, what is significant, timely and, finally, hopeful about Boogie Nights is the way Anderson proves that a movie can be mercilessly honest and mercifully humane at the same time."[20]

text: Awards[edit]

text: The film received box office success with Reynolds' depiction of Jack Horner garnering him twelve awards and three nominations, and Moore's depiction of Amber Waves garnering her six awards and nominations.

text:
Organization

Category

Nominee(s)

Result

70th Academy Awards

Best Supporting Actor

Burt Reynolds

Nominated

Best Supporting Actress

Julianne Moore

Nominated

Best Original Screenplay

Paul Thomas Anderson

Nominated

55th Golden Globe Awards

Best Supporting Actor – Motion Picture

Burt Reynolds

Won

Best Supporting Actress – Motion Picture

Julianne Moore

Nominated

51st British Academy Film Awards

Best Actor in a Supporting Role

Burt Reynolds

Nominated

Best Original Screenplay

Paul Thomas Anderson

Nominated

4th Screen Actors Guild Awards

Outstanding Performance by a Cast in a Motion Picture

Don Cheadle, Heather Graham, Luis Guzmán, Philip Baker Hall, Philip Seymour Hoffman, Thomas Jane, Ricky Jay, William H. Macy, Alfred Molina, Julianne Moore, Nicole Ari Parker, John C. Reilly, Burt Reynolds, Robert Ridgely, Mark Wahlberg and Melora Walters

Nominated

Outstanding Performance by a Male Actor in a Supporting Role

Burt Reynolds

Nominated

Outstanding Performance by a Female Actor in a Supporting Role

Julianne Moore

Nominated

2nd Golden Satellite Awards

Outstanding Motion Picture Ensemble

Won

Best Performance by an Actor in a Supporting Role in a Motion Picture – Drama

Burt Reynolds

Won

Best Performance by an Actress in a Supporting Role in a Motion Picture – Drama

Julianne Moore

Won

Best Motion Picture – Drama

Nominated

Best Director of a Motion Picture

Paul Thomas Anderson

Nominated

Best Motion Picture Screenplay – Original

Nominated

Best Performance by an Actor in a Motion Picture – Drama

Mark Wahlberg

Nominated

Outstanding Film Editing

Dylan Tichenor

Nominated

Boston Society of Film Critics Awards

Best New Filmmaker

Paul Thomas Anderson

Won

British Independent Film Awards

Best Foreign Independent Film – English Language

Won

Chicago Film Critics Association Awards

Best Supporting Actor

Burt Reynolds

Won

Dallas–Fort Worth Film Critics Association Awards

Best Supporting Actor

Won

Florida Film Critics Circle Awards

Best Cast

Won

Best Supporting Actress

Julianne Moore

Won

Las Vegas Film Critics Society Awards

Best Supporting Actor

Burt Reynolds

Won

Los Angeles Film Critics Association Awards

Best Supporting Actor

Won

Best Supporting Actress

Julianne Moore

Won

New Generation Award

Paul Thomas Anderson

Won

National Society of Film Critics Awards

Best Supporting Actor

Burt Reynolds

Won

Best Supporting Actress

Julianne Moore

Won

New York Film Critics Circle Awards

Best Supporting Actor

Burt Reynolds

Won

Writers Guild of America Awards

Best Original Screenplay

Paul Thomas Anderson

Nominated

text: Music[edit]

text: Two Boogie Nights soundtracks were released, the first at the time of the film's initial release and the second the following year. AllMusic rated the first soundtrack four and a half stars out of five[21] and the second soundtrack four.[22]

text:
Paul Thomas Anderson – executive producer
Karyn Rachtman – executive producer, music supervisor
Liz Heller – executive producer[23]
Bobby Lavelle – music supervisor
Carol Dunn – music coordinator

text:
Boogie Nights: Music from the Original Motion PictureSoundtrack albumReleased
October 7, 1997Genre
Disco, pop, soulLabel
Capitol

text:
Boogie Nights 2: More Music from the Original Motion PictureSoundtrack albumReleased
January 13, 1998Genre
Disco, pop, soulLabel
Capitol


document_title: United States military casualties of war

question_text: number of american casualties in world war ii

text: Overview[edit]

text:
War or Conflict
Date
Total U.S. Deaths
Wounded
Total U.S. Casualties
Missing
Sources & Notes

Combat
Other
Total

American Revolutionary War
1775–1783
8,000
17,000
25,000
25,000
50,000

Northwest Indian War
1785–1796
1,056+

1,056+
825+
1,881+

[1][2][3]

Quasi-War
1798–1800
20
494[4]
514
42
556

[4][5]

First Barbary War
1801–1805
35
39
74
64
138

[6][7]:25–27[8][9]

Other actions against pirates
1800–1900
36
158+[7]:42
194+
100+
294+

[5][10][11][b]

Chesapeake–Leopard Affair
1807
3
0
3
18
21

[5]

War of 1812
1812–1815
2,260
12,740~
15,000~
4,505
20,000~

[12]

Nuka Hiva Campaign
1813–1814
5
0
5
11
16

[7]:34–38

Creek War
1813–1814

575

[13]

Second Barbary War
1815
4
134[14]

10
148

[15]

First Seminole War
1817–1818
47
0
47
36
83

[16]

First Sumatran Expedition
1832
2

2
11
13

[5]

Black Hawk War
1832
47
258[17][18]
305
85
390

[19]

Second Seminole War
1835–1842
328
1,207
1,535

Mexican–American War
1846–1848
1,733
11,550
13,283
4,152
17,435

[20]

Cayuse War
1847–1856
40
1
41
74
115

[21]

Rogue River Wars
1851–1856
190
6
196
293
489

[22]

Yakima War
1855–1856
32
2
34
92
126

[23]

Third Seminole War
1855–1858
26

26
27
53

[24]

Second Opium War
1856–1860
12

12
39
51

[7]

Coeur d'Alene War
1858
36

36
60
96

[25]

Civil War: total
1861–1865
214,938
400K-500K
750,000~ [26]

[c][27]

Union

140,414
224,097
364,511
281,881
646,392

[28]

Confederate

74,524–94,000[29]
225,000~
299,524~

Dakota War of 1862
(Little Crow's War)
1862
70–113

70–113
150
220–263

[30][31][32]

Shimonoseki Straits
1863
4–5[5][33]
0
4–5
6[5]
10

[5][33]

Snake Indian War
1864–1868
30

30
128
158

[23]

Indian Wars
1865–1898
919

1,025

[20]

Red Cloud's War
1866–1868
126

126
100
226

[34][35][36]

Korea (Shinmiyangyo)
1871
3

3
9
12

[37]

Modoc War
1872–1873
56

56
88
144

[38][39]

Great Sioux War
1875–1877
314

314
211
525

[40][41]

Nez Perce War
1877
134

134
157
291

[42][43]

Bannock War
1878
12
0
12
22
34

[44][45]

Ute War
1879
15
0
15
52
67

[44][46]

Sheepeater Indian War
1879
1

1
10
11

[44]

Samoan crisis
1887–1889
0
62
62

62

[47]

Ghost Dance War
1890–1891
35

35
64
99

[48][49]

Sugar Point
Pillager Band of Chippewa Indians
1898
7
0
7
16
23
0
[50]

Spanish–American War
1898
385
2,061
2,446
1,622
4,068

[20]

Philippine–American War
1898–1913
1,020
3,176
4,196
2,930
7,126

[20]

Boxer Rebellion
1900–1901
68
63
131
204
335
0
[51]

Santo Domingo Affair
1904
1
0
1
2
3

[5]

United States occupation of Nicaragua
1910, 1912–1925, 1927–1933
90
69
159
290
449

[52][53][54]

Mexican Revolution
1914–1919
120
61
181
319
500

[55]

Occupation of Haiti
1915–1934
10
138
148
26+
184+

[5][56]

World War I
1917–1918
53,402
63,114
116,516
204,002
320,518
3,350
[20][d]

North Russia Campaign
1918–1920

424

[57]

American Expeditionary Force Siberia
1918–1920
160
168
328
52+
380+

[7]:228

China
1918; 1921; 1926–1927; 1930; 1937
5

78
83

[52]

World War II
1941–1945
291,557
113,842
405,399
670,846
1,076,245
30,314
[20]See Note DA below

Greek Civil War
1944-1949
1
5
6

6

[58]

Chinese Civil War
1945–1950
14
150
164
51
215

[58]

Berlin Blockade
1948–1949

31

[59]

Korean War
1950–1953
33,686
2,830
36,516
92,134
128,650
4,759
Note: 4,759 MIA-See Note E below

U.S.S.R. Cold War
1947–1991
32

12
44

[52]

China Cold War
1950–1972
16

16

[52]

Vietnam War
1955–1975
47,424
10,785
58,209
153,303
211,454
1,603
[20][60] Note as of 1 September 2017 Vietnam MIA Are 1,603

1958 Lebanon crisis
1958
1
5
6
1+
7+

Bay of Pigs Invasion
1961
4

4

4

[61]

Cuban Missile Crisis
1962
1
19
20

20

[58]

Dominican Republic
1965–1966
27
20
47
283
330

[52][58][62]

USS Liberty incident
1967
34

34
171

Iran
1980
0
8
8
4
12
0
[63]

El Salvador Civil War
1980–1992
22
15
37
35

[64][65][66][67]

Beirut deployment
1982–1984
256

266
169

[68]

Persian Gulf escorts
1987–1988
39
0
39
31

Invasion of Grenada
1983
18
1
19
119

[68]

1986 Bombing of Libya
1986
2
0
2
0
2

[69]

Invasion of Panama
1989
23

40
324

[68]

Gulf War
1990–1991
149
145
294
849
1,143
0[70]
[71]

Operation Provide Comfort
1991–1996
1
18
19
4
23

[72][73]

Somalia
1992–1993
29
14
43
153

[68]

Haiti
1994–1995
1

4
3

[68]

Colombia
1994–present
0
8[74][75]
8

[76]

Bosnia-Herzegovina
1995–2004
1
11
12

[77]

Kosovo War
1998–1999
4
14
18
N/A
18+
2
[78]

Afghanistan War
2001–present
1,954*
471
2,356
18,675
20,904
0
[f][79][80]

Iraq War
2003–2011
3,836*
961
4,497
32,222
36,710
2
[79]

Operation Inherent Resolve
2014–
4
11
14
17
28
1
[81]

Raid on Yemen
2017
1

3

[82]

Total
1775–present
666,441+
673,929+
1,354,664+
1,498,240+
2,852,901+
40,917+

text: Wars ranked by total number of American military deaths[edit]

text:
Rank
War
Years
Deaths
Deaths per Day
US Population in First Year of War
Deaths per Population

1
American Civil War
1861–65
750,000[26]
420
31,443,000
2.385% (1860)

2
World War II
1941–45
405,399
297
133,402,000
0.307% (1940)

3
World War I
1917–18
116,516
279
103,268,000
0.110% (1920)

4
Vietnam War
1961–75
58,209
11
179,323,175
0.032% (1970)

5
Korean War
1950–53
54,246
45
151,325,000
0.036% (1950)

6
American Revolutionary War
1775–83
25,000
11
2,500,000
1.00% (1780)

7
War of 1812
1812–15
15,000
15
8,000,000
0.207% (1810)

8
Mexican–American War
1846–48
13,283
29
21,406,000
0.057% (1850)

9
Iraq War/Afghanistan Wars
2001– 2014
7,222
2
294,043,000
0.002% (2010)

10
Philippine–American War
1899–1902
4,196
3.8
72,129,001
0.006% (1900)

text: "Deaths per day" is the total number of Americans killed in military service, divided by the number of days between the dates of the commencement and end of hostilities. "Deaths per population" is the total number of deaths in military service, divided by the U.S. population of the year indicated.

text:
Total American Deaths by War

Civil War

750,000

World War II

405,399

World War I

116,516

Vietnam

58,209

Korean War

54,246

Revolutionary

25,000

War of 1812

15,000

Mexican American

13,283

Iraq/Afghanistran Wars* present

7,222

Philippine–American War

4,196

text: Wars ranked by American combat deaths[edit]

text:
Rank
War
Years
Deaths

1
World War II
1941–45
291,557

2
American Civil War
1861–65
212,938

3
World War I
1917–18
53,402

4
Vietnam War
1955–75
47,424

5
Korean War
1950–53
33,746

6
American Revolutionary War
1775–83
8,000

7
Iraq War/Afghanistan Wars
2001–2014
5,650 [83]

8
War of 1812
1812–15
2,260

9
Mexican–American War
1846–48
1,733

10
Second Seminole War
1835–1842
1,500+

text:
American Combat Deaths by War

World War II

291,557

American Civil War

212,938

World War I

53,402

Vietnam

47,424

Korean War

33,746

American Revolutionary War

8,000

Iraq/Afghanistan Wars*

5,650

War of 1812

2,260

Mexican American War

1,733

Second Seminole War

1,500

text: Notes[edit]

text: a. ^ Revolutionary War: All figures from the Revolutionary War are rounded estimates. Commonly cited casualty figures provided by the Department of Defense are 4,435 killed and 6,188 wounded, although the original government report that generated these numbers warned that the totals were incomplete and far too low.[84] In 1974, historian Howard Peckham and a team of researchers came up with a total of 6,824 killed in action and 8,445 wounded. Because of incomplete records, Peckham estimated that this new total number of killed in action was still about 1,000 too low.[85] Military historian John Shy subsequently estimated the total killed in action at 8,000, and argued that the number of wounded was probably far higher, about 25,000.[86] The "other" deaths are primarily from disease, including prisoners who died on British prison ships.

text: b. ^ Other Actions Against Pirates: Includes actions fought in the West Indies, the Greek Isles, off of Louisiana, China and Vietnam. Other deaths resulted from disease and accidents.

text:
c. ^ Civil War: All Union casualty figures, and Confederate killed in action, from The Oxford Companion to American Military History except where noted (NPS figures).[20] estimate of total Confederate dead from James M. McPherson, Battle Cry of Freedom (Oxford University Press, 1988), 854. Newer estimates place the total death toll at 650,000 to 850,000.[26] 148 of the Union dead were U.S. Marines.[87]
CA. ^ Civil War April 2, 2012 Doctor David Hacker after extensive research offered new casualty rates higher by 20%; his work has been accepted by the academic community and is represented here.

text: d. ^ World War I figures include expeditions in North Russia and Siberia. See also World War I casualties

text: da.^ World War II Note: as of March 31, 1946 there were an estimated 286,959 dead of whom 246,492 were identified; of 40,467 who were unidentified 18,641 were located {10,986 reposed in military cemeteries and 7,655 in isolated graves} and 21,826 were reported not located. As of April 6, 1946 there were 539 American Military Cemeteries which contained 241,500 dead. Note the American Battle Monuments Commission database for the World War II reports that in 18 ABMC Cemeteries total of 93,238 buried and 78,979 missing and that "The World War II database on this web site contains the names of those buried at our cemeteries, or listed as Missing in Action, buried or lost at sea. It does not contain the names of the 233,174 Americans returned to the United States for burial..." Similarly, the ABMC Records do not cover inter-War deaths such as the Port Chicago disaster in which 320 died. As of July 2017 total of US World War II casualties {Military and Civilian} not recovered is 73,018[88]

text: e. ^ Korean War: Note:[20] gives Dead as 33,746 and Wounded as 103, 284 and MIA as 8,177. The American Battle Monuments Commission database for the Korean War reports that "The Department of Defense reports that 54,246 American service men and women lost their lives during the Korean War. This includes all losses worldwide. Since the Korean War Veterans Memorial in Washington, D.C. honors all U.S. Military who lost their lives during the War, we have tried to obtain the names of those who died in other areas besides Korea during the period June 27, 1950 to July 27, 1954, one year after the Korean Armistice...". {For a breakdown of Worldwide casualties of 54,246 see The Korean War educator at [89] gives figures as In-theatre/non theater} After their retreat in 1950, dead Marines and soldiers were buried at a temporary gravesite near Hungnam, North Korea. During "Operation Glory" which occurred from July to November 1954 the dead of each side were exchanged; remains of 4,167 US soldiers/Marines were exchanged for 13,528 North Korean/Chinese dead.[90] After "Operation Glory" 416 Korean War "unknowns" were buried in the Punchbowl Cemetery. According to a DPMO white paper [91] 1,394 names were also transmitted during "Operation Glory" from the Chinese and North Koreans, of whom 858 names proved to be correct; of the 4,167 returned remains were found to be 4,219 individuals of whom 2,944 were found to be Americans of whom all but 416 were identified by name. Of 239 Korean War unaccounted for: 186 not associated with Punchbowl unknowns (176 were identified and of the remaining 10 cases 4 were non-Americans of Asiatic descent; one was British; 3 were identified and 2 cases unconfirmed); Of 10 Korean War "Punchbowl Unknowns" 6 were identified. The W.A. Johnson listing of 496 POWs-including 25 Civilians [92]-who died in North Korea can be found here and there[93]

text: According to report of June 24, 2008 at [94]

text:
Number of remains total unaccounted for: 8,055
Number of remains repatriated are: 489 of whom 100 are identified

text: Update of report of October 26, 2011 at [95]

text:
Number of remains total unaccounted for: 7,983
Number of remains either repatriated from North/South Korea; China; Japan or disinterred from Punchbowl cemetery: 678 of which the number have been identified from 1982 to 2011: 174

text: Listed as MIA: 7,729 [96]

text: ea. ^ Cold War – Korea and Vietnam and Middle East-additional US Casualties:

text:
North Korea {Cold War} 1959:1968-1969;1976;1984 killed 41; Wounded 5; 82 captured/released.[97]
USS Liberty incident 1967 killed 34; Wounded 173 by Israeli armed forces
Vietnam War prior to 1964-US Casualties were Laos-2 killed in 1954; and Vietnam 1946–1954 2 killed see;[98]

text: f. ^ Iraq War. See also Casualties of the Iraq War. Sources: .[99]

text: g. ^ Afghanistan. Casualties include those that occurred in Pakistan, Uzbekistan, Djibouti, Eritrea, Ethiopia, Guantanamo Bay (Cuba), Jordan, Kenya, Kyrgyzstan, Philippines, Seychelles, Sudan, Tajikistan, Turkey, and Yemen.